var Client = require("../client"),
    BrowserProcessor = require("../processors/browser_processor"),
    BrowserReporter = require("../reporters/browser_reporter");

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

function getProcessor(client) {
  var key = client.getKey(),
      environment = client.getEnvironment(),
      guess_function_name = client.getGuessFunctionName(),
      error_defaults = client.getErrorDefaults(),
      document_location_hash = document.location.hash,
      navigator_user_agent = window.navigator.userAgent,
      app_root = window.location.protocol + '//' + window.location.host;

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

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

function getReporter(client) {
  return new BrowserReporter();
}

var client = new Client(getProcessor, getReporter);

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

@@ -315,15 +315,284 @@
 %7B%0A  
-var key
+// 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                
  = c
@@ -625,16 +625,24 @@
 ronment 
+        
 = client
@@ -740,16 +740,21 @@
 efaults 
+     
 = client
@@ -776,193 +776,8 @@
 ts()
-,%0A      document_location_hash = document.location.hash,%0A      navigator_user_agent = window.navigator.userAgent,%0A      app_root = window.location.protocol + '//' + window.location.host
 ;%0A%0A 

Clean up singleton getProcessor