anchor.diff:      application:stop(public_key),
       application:stop(ibrowse),
       application:stop(inets),
  -    case whereis(polling_monitor) of
  +    stop_if_running(polling_monitor),
  +    stop_if_running(polling_supervisor),
  +    stop_if_running(vstream_sup),
  +    Res.
  +
  +%% @spec stop() -> ok
  +%% @doc Stop the given module if running using the PID
  +stop_if_running(Atom) ->
  +    case whereis(Atom) of
           undefined -> ok;
  -        P_M_Pid ->
  -            exit(P_M_Pid, "stop")
  -    end,
  -    case whereis(polling_supervisor) of
  -        undefined -> ok;
  -        P_S_Pid ->
  -            exit(P_S_Pid, "stop")
  -    end,
  -    case whereis(vstream_sup) of
  -        undefined -> ok;
  -        V_S_Pid ->
  -            exit(V_S_Pid, "stop")
  -    end,
  -    Res.
  +        Pid       -> exit(Pid, "stop")
  +    end.
  
positive.code:     ensure_started(compiler),
      ensure_started(syntax_tools),
      ensure_started(mochiweb),
      application:set_env(webmachine, webmachine_logger_module,
                         webmachine_logger),
      ensure_started(webmachine),
      application:start(engine).
  
  
negative.code: 
  ensure_started(App) ->
      case application:start(App) of
          ok -> ok;
          {error, {already_started, App}} -> ok
      end.
  
  %% @spec start_link() -> {ok,Pid::pid()}
  