var Client = require("../client"),
    Processor = require("../processors/browser_processor"),

// This error-to-array-of-strings implementation can be swapped out
var printStackTrace = require("stacktrace-js");
    Reporter  = require("../reporters/api_v3_reporter");

function getProcessor(client) {
  // Vars from global
  var document_location_hash = global.document.location.hash,
      navigator_user_agent   = global.navigator.userAgent,
      app_root               = global.location.protocol + '//' + global.location.host;

  // Vars from client
  var key                 = client.getKey(),
      environment         = client.getEnvironment(),
      guess_function_name = client.getGuessFunctionName(),
      error_defaults      = client.getErrorDefaults();

  function splitErrorBacktrace(error) {
    var options = {
      e: error,
      guess: guess_function_name
    };
    return printStackTrace(options);
  }

  return new Processor(splitErrorBacktrace, key, environment, error_defaults, document_location_hash, navigator_user_agent, app_root);
}

function getReporter(client) {
  // TODO: Examine this, should we just default to ssl? What happens with spdy?
  var protocol = ("https:" === global.location.protocol ? "https://" : "http://");

  // Vars from client
  var host       = client.getHost(),
      project_id = client.getProjectId(),
      key        = client.getKey();

  var url = protocol + host + "/api/v3/projects/" + project_id + "/notices?key=" + key;

  return new Reporter(url);
}

var client = new Client(getProcessor, getReporter);

global.NewAirbrake = client;
global.Airbrake = global.Airbrake || client;
global.Hoptoad = global.Airbrake;

@@ -71,15 +71,16 @@
 ors/
-browser
+tracekit
 _pro
@@ -93,971 +93,121 @@
 %22),%0A
-%0A// This error-to-array-of-strings implementation can be swapped out%0Avar printStackTrace = require(%22stacktrace-js%22);%0A    Reporter  = require(%22../reporters/api_v3_reporter%22);%0A%0Afunction getProcessor(client) %7B%0A  // Vars from global%0A  var document_location_hash = global.document.location.hash,%0A      navigator_user_agent   = global.navigator.userAgent,%0A      app_root               = global.location.protocol + '//' + global.location.host;%0A%0A  // Vars from client%0A  var key                 = client.getKey(),%0A      environment         = client.getEnvironment(),%0A      guess_function_name = client.getGuessFunctionName(),%0A      error_defaults      = client.getErrorDefaults();%0A%0A  function splitErrorBacktrace(error) %7B%0A    var options = %7B%0A      e: error,%0A      guess: guess_function_name%0A    %7D;%0A    return printStackTrace(options);%0A  %7D%0A%0A  return new Processor(splitErrorBacktrace, key, environment, error_defaults, document_location_hash, navigator_user_agent, app_root
+    Reporter  = require(%22../reporters/api_v3_reporter%22);%0A%0Afunction getProcessor(client) %7B%0A  return new Processor(
 );%0A%7D
@@ -438,24 +438,25 @@
  host       
+ 
 = client.get
@@ -480,16 +480,17 @@
 ject_id 
+ 
 = client
@@ -515,32 +515,33 @@
      key        
+ 
 = client.getKey(
@@ -541,16 +541,61 @@
 getKey()
+,%0A      environment = client.getEnvironment()
 ;%0A%0A  var
@@ -703,16 +703,29 @@
 rter(url
+, environment
 );%0A%7D%0A%0Ava
@@ -775,16 +775,51 @@
 rter);%0A%0A
+// require(%22../legacy-notifier%22);%0A%0A
 global.N

Simplify Airbrake Singleton, thread environment