diff --git a/browserid/static/dialog/controllers/authenticate_controller.js b/browserid/static/dialog/controllers/authenticate_controller.js
index 80c34e364c7cdb4e51b76905ee366f41afe62c50..aceadf2b606fccd51a17f0735c6f21be2f518a4c 100644
--- a/browserid/static/dialog/controllers/authenticate_controller.js
+++ b/browserid/static/dialog/controllers/authenticate_controller.js
@@ -1,5 +1,5 @@
 /*jshint browser:true, jQuery: true, forin: true, laxbreak:true */
-/*global BrowserIDIdentities: true, BrowserIDWait:true, BrowserIDErrors: true, PageController: true */
+/*global BrowserID, PageController: true */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
@@ -38,7 +38,7 @@
   "use strict";
 
   var ANIMATION_TIME = 250,
-      identities = BrowserIDIdentities;
+      identities = BrowserID.Identities;
 
   function checkEmail() {
     var email = $("#email").val(), 
@@ -80,7 +80,7 @@
       else {
         // XXX can't register this email address.
       }
-    }, self.getErrorDialog(BrowserIDErrors.createAccount));
+    }, self.getErrorDialog(BrowserID.Errors.createAccount));
   }
 
   function authenticate() {
@@ -96,7 +96,7 @@
     identities.authenticateAndSync(email, pass, 
       function onAuthenticate(authenticated) {
         if (authenticated) {
-          self.doWait(BrowserIDWait.authentication);
+          self.doWait(BrowserID.Wait.authentication);
         } 
         else {
           // XXX error screen
@@ -111,7 +111,7 @@
           // XXX error screen.
         }
       }, 
-      self.getErrorDialog(BrowserIDErrors.authentication)
+      self.getErrorDialog(BrowserID.Errors.authentication)
     );
 
   }
diff --git a/browserid/static/dialog/controllers/checkregistration_controller.js b/browserid/static/dialog/controllers/checkregistration_controller.js
index e675e8e7e35e7d01d45e5636dc10d869bb7c952a..eeb01baffbc7982031bcff65e5d0b1cd3793c15f 100644
--- a/browserid/static/dialog/controllers/checkregistration_controller.js
+++ b/browserid/static/dialog/controllers/checkregistration_controller.js
@@ -1,5 +1,5 @@
 /*jshint browser:true, jQuery: true, forin: true, laxbreak:true */                                             
-/*global BrowserIDIdentities: true, BrowserIDErrors: true, PageController: true */ 
+/*global BrowserID: true, PageController: true */ 
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
@@ -37,7 +37,7 @@
 (function() {
   "use strict";
 
-  var identities = BrowserIDIdentities;
+  var identities = BrowserID.Identities;
 
   PageController.extend("Checkregistration", {}, {
     init: function(el, options) {
@@ -60,7 +60,7 @@
         identities.syncEmailKeypairs(function() {
           me.close(me.verificationMessage);
         });
-      }, me.getErrorDialog(BrowserIDErrors.registration));
+      }, me.getErrorDialog(BrowserID.Errors.registration));
     }
   });
 
diff --git a/browserid/static/dialog/controllers/dialog_controller.js b/browserid/static/dialog/controllers/dialog_controller.js
index b29e2d2a12a6374006a1005e8c34979d4c98e976..0ba484d28a9c3b6d4794f3e0ece0a72011a837ba 100644
--- a/browserid/static/dialog/controllers/dialog_controller.js
+++ b/browserid/static/dialog/controllers/dialog_controller.js
@@ -1,5 +1,5 @@
 /*jshint browser:true, jQuery: true, forin: true, laxbreak:true */                                             
-/*global setupChannel:true, BrowserIDIdentities: true, BrowserIDWait:true, BrowserIDErrors: true, PageController: true, OpenAjax: true */ 
+/*global setupChannel:true, BrowserID: true, PageController: true, OpenAjax: true */ 
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
@@ -59,7 +59,7 @@ PageController.extend("Dialog", {}, {
       this.onsuccess = onsuccess;
       this.onerror = onerror;
 
-      BrowserIDIdentities.setOrigin(origin_url);
+      BrowserID.Identities.setOrigin(origin_url);
 
       this.doStart();
 
@@ -186,7 +186,7 @@ PageController.extend("Dialog", {}, {
     doEmailSelected: function(email) {
       var self=this;
       // yay!  now we need to produce an assertion.
-      BrowserIDIdentities.getAssertion(email, function(assertion) {
+      BrowserID.Identities.getAssertion(email, function(assertion) {
         // Clear onerror before the call to onsuccess - the code to onsuccess 
         // calls window.close, which would trigger the onerror callback if we 
         // tried this afterwards.
@@ -196,20 +196,20 @@ PageController.extend("Dialog", {}, {
     },
 
     doNotMe: function() {
-      BrowserIDIdentities.logoutUser(this.doAuthenticate.bind(this));
+      BrowserID.Identities.logoutUser(this.doAuthenticate.bind(this));
     },
 
     syncEmailKeypairs: function() {
       var self = this;
-      BrowserIDIdentities.syncEmailKeypairs(self.doSignIn.bind(self), 
-        self.getErrorDialog(BrowserIDErrors.signIn));
+      BrowserID.Identities.syncEmailKeypairs(self.doSignIn.bind(self), 
+        self.getErrorDialog(BrowserID.Errors.signIn));
     },
 
 
     doCheckAuth: function() {
       var self=this;
-      self.doWait(BrowserIDWait.checkAuth);
-      BrowserIDIdentities.checkAuthenticationAndSync(function onSuccess() {}, 
+      self.doWait(BrowserID.Wait.checkAuth);
+      BrowserID.Identities.checkAuthenticationAndSync(function onSuccess() {}, 
         function onComplete(authenticated) {
           if (authenticated) {
               self.doSignIn();
@@ -217,7 +217,7 @@ PageController.extend("Dialog", {}, {
             self.doAuthenticate();
           }
         }, 
-        self.getErrorDialog(BrowserIDErrors.checkAuthentication));
+        self.getErrorDialog(BrowserID.Errors.checkAuthentication));
   }
 
   });
diff --git a/browserid/static/dialog/controllers/pickemail_controller.js b/browserid/static/dialog/controllers/pickemail_controller.js
index 85e758137da1a71b8b02d58f70a01635c61c101d..db926e9fc00c924f4f2e1ceb0f1c3ace13de16a7 100644
--- a/browserid/static/dialog/controllers/pickemail_controller.js
+++ b/browserid/static/dialog/controllers/pickemail_controller.js
@@ -1,5 +1,5 @@
 /*jshint brgwser:true, jQuery: true, forin: true, laxbreak:true */                                             
-/*global _: true, BrowserIDIdentities: true, PageController: true */ 
+/*global _: true, BrowserID: true, PageController: true */ 
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
@@ -38,7 +38,7 @@
   "use strict";
 
   var ANIMATION_TIME = 250,
-      identities = BrowserIDIdentities;
+      identities = BrowserID.Identities;
 
   function animateSwap(fadeOutSelector, fadeInSelector, callback) {
     // XXX instead of using jQuery here, think about using CSS animations.
diff --git a/browserid/static/dialog/dialog.js b/browserid/static/dialog/dialog.js
index 8f29abb4dc029a34a32a80ab5d9ad66fbad13115..88e4066dc4ce6fcdcaf0a7b65be6d7b2554547b5 100644
--- a/browserid/static/dialog/dialog.js
+++ b/browserid/static/dialog/dialog.js
@@ -51,6 +51,7 @@ steal.plugins(
                'base64',
                'underscore-min',
                'channel',
+               'browserid',
                'storage',
                'browserid-extensions',
                'browserid-network',
diff --git a/browserid/static/dialog/resources/browserid-errors.js b/browserid/static/dialog/resources/browserid-errors.js
index fe8703706f9028bf9abcb0cae4b054cf18547758..dd7ee7313210e4a5dd20645c2c06ed030e77fd05 100644
--- a/browserid/static/dialog/resources/browserid-errors.js
+++ b/browserid/static/dialog/resources/browserid-errors.js
@@ -32,7 +32,7 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
-var BrowserIDErrors = (function(){
+BrowserID.Errors = (function(){
   "use strict";
 
   var Errors = {
diff --git a/browserid/static/dialog/resources/browserid-extensions.js b/browserid/static/dialog/resources/browserid-extensions.js
index 1d45a366caec5dbdd111c8028d12846c5c388e36..01e670ab98b36de96b5b4992df0053b944b8c29c 100644
--- a/browserid/static/dialog/resources/browserid-extensions.js
+++ b/browserid/static/dialog/resources/browserid-extensions.js
@@ -33,26 +33,37 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
-if (!Function.prototype.bind) {
+(function() {
+  "use strict";
 
-  Function.prototype.bind = function (oThis) {
+  if (!Function.prototype.bind) {
 
-    if (typeof this !== "function") // closest thing possible to the ECMAScript 5 internal IsCallable function
-      throw new TypeError("Function.prototype.bind - what is trying to be fBound is not callable");
+    Function.prototype.bind = function (oThis) {
 
-    var aArgs = Array.prototype.slice.call(arguments, 1), 
-    fToBind = this, 
-    fNOP = function () {},
-    fBound = function () {
-      return fToBind.apply(this instanceof fNOP ? this : oThis || window, aArgs.concat(Array.prototype.slice.call(arguments)));    
-    };
+      if (typeof this !== "function") // closest thing possible to the ECMAScript 5 internal IsCallable function
+        throw new TypeError("Function.prototype.bind - what is trying to be fBound is not callable");
+
+      var aArgs = Array.prototype.slice.call(arguments, 1), 
+      fToBind = this, 
+      fNOP = function () {},
+      fBound = function () {
+        return fToBind.apply(this instanceof fNOP ? this : oThis || window, aArgs.concat(Array.prototype.slice.call(arguments)));    
+      };
 
-    fNOP.prototype = this.prototype;
-    fBound.prototype = new fNOP();
+      fNOP.prototype = this.prototype;
+      fBound.prototype = new fNOP();
 
-    return fBound;
+      return fBound;
+
+    };
 
-  };
+  }
 
-}
+  if(!window.console) {
+    window.console = {};
+  }
 
+  if(!console.log) {
+    console.log = function() {};
+  }
+}());
diff --git a/browserid/static/dialog/resources/browserid-identities.js b/browserid/static/dialog/resources/browserid-identities.js
index 8f34fecdea64dd14c7ea26be5a7b8218285d0e66..8592ad0653385e40324a7112d9f9e4f813cc7fd1 100644
--- a/browserid/static/dialog/resources/browserid-identities.js
+++ b/browserid/static/dialog/resources/browserid-identities.js
@@ -1,5 +1,5 @@
 /*jshint browsers:true, forin: true, laxbreak: true */
-/*global _: true, BrowserIDStorage: true, BrowserIDNetwork: true */
+/*global _: true, BrowserID: true */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
@@ -35,12 +35,12 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
-var BrowserIDIdentities = (function() {
+BrowserID.Identities = (function() {
   "use strict";
 
   var jwk, jwt, vep, jwcert, origin,
-      network = BrowserIDNetwork,
-      storage = BrowserIDStorage;
+      network = BrowserID.Network,
+      storage = BrowserID.Storage;
 
   function prepareDeps() {
     if (!jwk) {
@@ -139,8 +139,8 @@ var BrowserIDIdentities = (function() {
     /**
      * Set the interface to use for networking.  Used for unit testing.
      * @method setNetwork
-     * @param {BrowserIDNetwork} networkInterface - BrowserIDNetwork interface 
-     * to use.
+     * @param {BrowserID.Network} networkInterface - BrowserID.Network 
+     * compatible interface to use.
      */
     setNetwork: function(networkInterface) {
       network = networkInterface;
diff --git a/browserid/static/dialog/resources/browserid-network.js b/browserid/static/dialog/resources/browserid-network.js
index 0f923b6fbe8fc3216051d1720fdeeffd3e0bf578..afd926599e6a0f93411ad6aa4ab4ba51e003cd96 100644
--- a/browserid/static/dialog/resources/browserid-network.js
+++ b/browserid/static/dialog/resources/browserid-network.js
@@ -1,5 +1,5 @@
 /*jshint browsers:true, forin: true, laxbreak: true */
-/*global BrowserIDStorage: true, _: true */
+/*global BrowserID: true, _: true */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
@@ -34,7 +34,7 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
-var BrowserIDNetwork = (function() {
+BrowserID.Network = (function() {
   "use strict";
 
   var csrf_token,
diff --git a/browserid/static/dialog/resources/browserid-wait.js b/browserid/static/dialog/resources/browserid-wait.js
index 6e4e6fe0849060074679ef9d218be1155b1eaa05..190074c3096c8df63338351037e84a0805912ac3 100644
--- a/browserid/static/dialog/resources/browserid-wait.js
+++ b/browserid/static/dialog/resources/browserid-wait.js
@@ -32,7 +32,7 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
-var BrowserIDWait = (function(){
+BrowserID.Wait = (function(){
   "use strict";
 
   var Wait = {
diff --git a/browserid/static/dialog/resources/browserid.js b/browserid/static/dialog/resources/browserid.js
new file mode 100644
index 0000000000000000000000000000000000000000..c91ee8a4d86cff04a752f27c735a9e42019c768c
--- /dev/null
+++ b/browserid/static/dialog/resources/browserid.js
@@ -0,0 +1,41 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla BrowserID.
+ *
+ * The Initial Developer of the Original Code is Mozilla.
+ * Portions created by the Initial Developer are Copyright (C) 2011
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+(function() {
+  "use strict";
+
+  window.BrowserID = window.BrowserID || {};
+
+}());
diff --git a/browserid/static/dialog/resources/storage.js b/browserid/static/dialog/resources/storage.js
index 1fcfbc0af0ebf90a13e90b7281b9021cbb04df6d..1a1ce7cc8976835a6cbdcee4a7870c88e2b9541a 100644
--- a/browserid/static/dialog/resources/storage.js
+++ b/browserid/static/dialog/resources/storage.js
@@ -33,7 +33,7 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
-var BrowserIDStorage = (function() {
+BrowserID.Storage = (function() {
   
   var jwk;
   
diff --git a/browserid/static/dialog/test/qunit/browserid-identities_functional_test.js b/browserid/static/dialog/test/qunit/browserid-identities_functional_test.js
index 4148b6b8a4022d99722af8a1efe7922e7c0c4101..ee268426cb1cc99a1117bdad3b7e103da9092e86 100644
--- a/browserid/static/dialog/test/qunit/browserid-identities_functional_test.js
+++ b/browserid/static/dialog/test/qunit/browserid-identities_functional_test.js
@@ -1,5 +1,5 @@
 /*jshint browsers:true, forin: true, laxbreak: true */
-/*global steal: true, test: true, start: true, stop: true, module: true, ok: true, equal: true, BrowserIDStorage.clearEmails: true, BrowserIDNetwork: true , BrowserIDIdentities: true */
+/*global steal: true, test: true, start: true, stop: true, module: true, ok: true, equal: true, BrowserID: true */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
@@ -49,13 +49,13 @@ steal.plugins("jquery", "funcunit/qunit").then("/dialog/resources/browserid-iden
   }
 
   test("getStoredIdentities", function() {
-    var identities = BrowserIDIdentities.getStoredIdentities();
+    var identities = BrowserID.Identities.getStoredIdentities();
     equal("object", typeof identities, "we have some identities");
   });
 
   test("clearStoredIdentities", function() {
-    BrowserIDIdentities.clearStoredIdentities();
-    var identities = BrowserIDIdentities.getStoredIdentities();
+    BrowserID.Identities.clearStoredIdentities();
+    var identities = BrowserID.Identities.getStoredIdentities();
     var count = 0;
     for(var key in identities) { 
       if(identities.hasOwnProperty(key)) {
@@ -67,7 +67,7 @@ steal.plugins("jquery", "funcunit/qunit").then("/dialog/resources/browserid-iden
   });
 
   test("stageIdentity", function() {
-    BrowserIDIdentities.stageIdentity("testuser@testuser.com", "testuser", function(keypair) {
+    BrowserID.Identities.stageIdentity("testuser@testuser.com", "testuser", function(keypair) {
       equal("object", typeof keypair, "We have a key pair");
       start();
     }, failure("stageIdentity failure"));
@@ -76,7 +76,7 @@ steal.plugins("jquery", "funcunit/qunit").then("/dialog/resources/browserid-iden
   });
 
   test("confirmIdentity", function() {
-  /*  BrowserIDIdentities.confirmIdentity("testuser@testuser.com", function() {
+  /*  BrowserID.Identities.confirmIdentity("testuser@testuser.com", function() {
       start();
     });
 
@@ -85,10 +85,10 @@ steal.plugins("jquery", "funcunit/qunit").then("/dialog/resources/browserid-iden
   });
 
   test("authenticateAndSync", function() {
-    BrowserIDStorage.clearEmails();
-    BrowserIDIdentities.authenticateAndSync("testuser@testuser.com", "testuser", function() {
+    BrowserID.Storage.clearEmails();
+    BrowserID.Identities.authenticateAndSync("testuser@testuser.com", "testuser", function() {
     }, function() {
-      var identities = BrowserIDIdentities.getStoredIdentities();
+      var identities = BrowserID.Identities.getStoredIdentities();
       ok("testuser@testuser.com" in identities, "authenticateAndSync syncs email addresses");
       start();
     }, failure("Authentication failure"));
@@ -98,10 +98,10 @@ steal.plugins("jquery", "funcunit/qunit").then("/dialog/resources/browserid-iden
   });
 
   test("checkAuthenticationAndSync", function() {
-    BrowserIDNetwork.authenticate("testuser@testuser.com", "testuser", function() {
-      BrowserIDStorage.clearEmails();
-      BrowserIDIdentities.checkAuthenticationAndSync(function() {
-        var identities = BrowserIDIdentities.getStoredIdentities();
+    BrowserID.Network.authenticate("testuser@testuser.com", "testuser", function() {
+      BrowserID.Storage.clearEmails();
+      BrowserID.Identities.checkAuthenticationAndSync(function() {
+        var identities = BrowserID.Identities.getStoredIdentities();
         ok("testuser@testuser.com" in identities, "checkAuthenticationAndSync syncs email addresses");
         start();
       });
@@ -111,12 +111,12 @@ steal.plugins("jquery", "funcunit/qunit").then("/dialog/resources/browserid-iden
   });
 
   test("addIdentity", function() {
-    BrowserIDNetwork.authenticate("testuser@testuser.com", "testuser", function() {
-      BrowserIDIdentities.removeIdentity("testemail@testemail.com", function() {
-        BrowserIDIdentities.addIdentity("testemail@testemail.com", function(keypair) {
+    BrowserID.Network.authenticate("testuser@testuser.com", "testuser", function() {
+      BrowserID.Identities.removeIdentity("testemail@testemail.com", function() {
+        BrowserID.Identities.addIdentity("testemail@testemail.com", function(keypair) {
           equal("object", typeof keypair, "we have a keypair");
 
-          var identities = BrowserIDIdentities.getStoredIdentities();
+          var identities = BrowserID.Identities.getStoredIdentities();
           equal(false, "testemail@testemail.com" in identities, "Our new email is not added until confirmation.");
 
           start();
@@ -129,10 +129,10 @@ steal.plugins("jquery", "funcunit/qunit").then("/dialog/resources/browserid-iden
 
   /*
   test("syncIdentity on confirmed email address", function() {
-    BrowserIDNetwork.authenticate("testuser@testuser.com", "testuser", function() {
-      BrowserIDIdentities.removeIdentity("testemail@testemail.com", "issuer", function() {
+    BrowserID.Network.authenticate("testuser@testuser.com", "testuser", function() {
+      BrowserID.Identities.removeIdentity("testemail@testemail.com", "issuer", function() {
         // XXX verify the identity here 
-        BrowserIDIdentities.syncIdentity("testemail@testemail.com", "issuer", function(keypair) {
+        BrowserID.Identities.syncIdentity("testemail@testemail.com", "issuer", function(keypair) {
           ok(false, "Syncing a non-verified identity should fail");
 
           start();
@@ -145,17 +145,17 @@ steal.plugins("jquery", "funcunit/qunit").then("/dialog/resources/browserid-iden
 */
 
   test("persistIdentity", function() {
-    BrowserIDIdentities.persistIdentity("testemail2@testemail.com", { pub: "pub", priv: "priv" });
-    var identities = BrowserIDIdentities.getStoredIdentities();
+    BrowserID.Identities.persistIdentity("testemail2@testemail.com", { pub: "pub", priv: "priv" });
+    var identities = BrowserID.Identities.getStoredIdentities();
     ok("testemail2@testemail.com" in identities, "Our new email is added");
   });
 
   /*
   test("removeIdentity that we add", function() {
-    BrowserIDNetwork.authenticate("testuser@testuser.com", "testuser", function() {
-      BrowserIDIdentities.syncIdentity("testemail@testemail.com", "issuer", function(keypair) {
-        BrowserIDIdentities.removeIdentity("testemail@testemail.com", function() {
-          var identities = BrowserIDIdentities.getStoredIdentities();
+    BrowserID.Network.authenticate("testuser@testuser.com", "testuser", function() {
+      BrowserID.Identities.syncIdentity("testemail@testemail.com", "issuer", function(keypair) {
+        BrowserID.Identities.removeIdentity("testemail@testemail.com", function() {
+          var identities = BrowserID.Identities.getStoredIdentities();
           equal(false, "testemail@testemail.com" in identities, "Our new email is removed");
           start();
         }, failure("removeIdentity failure"));
@@ -166,9 +166,9 @@ steal.plugins("jquery", "funcunit/qunit").then("/dialog/resources/browserid-iden
   });
   */
   test("syncIdentities with no identities", function() {
-    BrowserIDStorage.clearEmails();
-    BrowserIDNetwork.authenticate("testuser@testuser.com", "testuser", function() {
-      BrowserIDIdentities.syncIdentities(function onSuccess() {
+    BrowserID.Storage.clearEmails();
+    BrowserID.Network.authenticate("testuser@testuser.com", "testuser", function() {
+      BrowserID.Identities.syncIdentities(function onSuccess() {
         ok(true, "we have synced identities");
         start();
       }, failure("identity sync failure"));
@@ -178,8 +178,8 @@ steal.plugins("jquery", "funcunit/qunit").then("/dialog/resources/browserid-iden
   });
 
   test("syncIdentities with identities preloaded", function() {
-    BrowserIDNetwork.authenticate("testuser@testuser.com", "testuser", function() {
-      BrowserIDIdentities.syncIdentities(function onSuccess() {
+    BrowserID.Network.authenticate("testuser@testuser.com", "testuser", function() {
+      BrowserID.Identities.syncIdentities(function onSuccess() {
         ok(true, "we have synced identities");
         start();
       }, failure("identity sync failure"));
@@ -189,8 +189,8 @@ steal.plugins("jquery", "funcunit/qunit").then("/dialog/resources/browserid-iden
   });
 
   test("getIdentityAssertion", function() {
-    BrowserIDNetwork.authenticate("testuser@testuser.com", "testuser", function() {
-      BrowserIDIdentities.getIdentityAssertion("testuser@testuser.com", function(assertion) {
+    BrowserID.Network.authenticate("testuser@testuser.com", "testuser", function() {
+      BrowserID.Identities.getIdentityAssertion("testuser@testuser.com", function(assertion) {
         equal("string", typeof assertion, "we have an assertion!");
         start();
       });
@@ -201,17 +201,17 @@ steal.plugins("jquery", "funcunit/qunit").then("/dialog/resources/browserid-iden
 
   /*
   test("syncIdentity on non-confirmed email address", function() {
-    BrowserIDStorage.clearEmails();
-    BrowserIDNetwork.authenticate("testuser@testuser.com", "testuser", function() {
-      BrowserIDIdentities.removeIdentity("testemail@testemail.com", function() {
-        BrowserIDIdentities.syncIdentity("testemail@testemail.com", "issuer", function(keypair) {
+    BrowserID.Storage.clearEmails();
+    BrowserID.Network.authenticate("testuser@testuser.com", "testuser", function() {
+      BrowserID.Identities.removeIdentity("testemail@testemail.com", function() {
+        BrowserID.Identities.syncIdentity("testemail@testemail.com", "issuer", function(keypair) {
           ok(false, "Syncing a non-verified identity should fail");
 
           start();
         }, function() {
           ok(true, "trying to sync an identity that is not yet verified should fail");
 
-          var identities = BrowserIDIdentities.getStoredIdentities();
+          var identities = BrowserID.Identities.getStoredIdentities();
           equal("testemail@testemail.com" in identities, false, "Our new email is added");
 
           start();
@@ -223,26 +223,26 @@ steal.plugins("jquery", "funcunit/qunit").then("/dialog/resources/browserid-iden
   });
 
   test("syncIdentity without first validating email", function() {
-    BrowserIDNetwork.authenticate("testuser@testuser.com", "testuser", function() {
+    BrowserID.Network.authenticate("testuser@testuser.com", "testuser", function() {
       // First, force removal that way we know it is not part of our list.
-      BrowserIDIdentities.removeIdentity("unvalidated@unvalidated.com", function() {
+      BrowserID.Identities.removeIdentity("unvalidated@unvalidated.com", function() {
 
-        BrowserIDStorage.clearEmails();
-        BrowserIDIdentities.syncIdentities(function onSuccess() {
+        BrowserID.Storage.clearEmails();
+        BrowserID.Identities.syncIdentities(function onSuccess() {
 
-          var identities = BrowserIDIdentities.getStoredIdentities();
+          var identities = BrowserID.Identities.getStoredIdentities();
           // Make sure the server has forgotten about this email address.
           equal("unvalidated@unvalidated.com" in identities, false, "The removed email should not be on the list.");
 
           // This next call will call /wsapi/set_key on a 
           // key that has not been validated.
-          BrowserIDIdentities.syncIdentity("unvalidated@unvalidated.com", "issuer", function(keypair) {
+          BrowserID.Identities.syncIdentity("unvalidated@unvalidated.com", "issuer", function(keypair) {
             // Clear all the local emails, then refetch the list from the server
             // just to be sure we are seeing what the server sees.
-            BrowserIDStorage.clearEmails();
-            BrowserIDIdentities.syncIdentities(function onSuccess() {
+            BrowserID.Storage.clearEmails();
+            BrowserID.Identities.syncIdentities(function onSuccess() {
 
-              var identities = BrowserIDIdentities.getStoredIdentities();
+              var identities = BrowserID.Identities.getStoredIdentities();
               // woah.  Things just went wrong.
               equal("unvalidated@unvalidated.com" in identities, false, "The unvalidated email should not be added just through calling sync_key");
               start();
diff --git a/browserid/static/dialog/test/qunit/browserid-identities_unit_test.js b/browserid/static/dialog/test/qunit/browserid-identities_unit_test.js
index b0e52eca177e8f47d4efea62f405908ec8ed75cc..2ecc46c18cdefad5ca741174eb5a7ac78212179f 100644
--- a/browserid/static/dialog/test/qunit/browserid-identities_unit_test.js
+++ b/browserid/static/dialog/test/qunit/browserid-identities_unit_test.js
@@ -1,5 +1,5 @@
 /*jshint browsers:true, forin: true, laxbreak: true */
-/*global steal: true, test: true, start: true, stop: true, module: true, ok: true, equal: true, BrowserIDStorage:true, BrowserIDNetwork: true , BrowserIDIdentities: true */
+/*global steal: true, test: true, start: true, stop: true, module: true, ok: true, equal: true, BrowserID: true */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
@@ -42,9 +42,9 @@ var jwk = require("./jwk");
 var jwcert = require("./jwcert");
 
 steal.plugins("jquery", "funcunit/qunit").then("/dialog/resources/browserid-identities", function() {
-  var lib = BrowserIDIdentities,
-      network = BrowserIDNetwork,
-      storage = BrowserIDStorage;
+  var lib = BrowserID.Identities,
+      network = BrowserID.Network,
+      storage = BrowserID.Storage;
 
   // I generated these locally, they are used nowhere else.
   var pubkey = {"algorithm":"RS","n":"56063028070432982322087418176876748072035482898334811368408525596198252519267108132604198004792849077868951906170812540713982954653810539949384712773390200791949565903439521424909576832418890819204354729217207360105906039023299561374098942789996780102073071760852841068989860403431737480182725853899733706069","e":"65537"};
@@ -164,7 +164,7 @@ steal.plugins("jquery", "funcunit/qunit").then("/dialog/resources/browserid-iden
       emailCheckCount = 0;
     },
     teardown: function() {
-      lib.setNetwork(BrowserIDNetwork);
+      lib.setNetwork(BrowserID.Network);
     }
   });
 
diff --git a/browserid/static/dialog/test/qunit/browserid-network_test.js b/browserid/static/dialog/test/qunit/browserid-network_test.js
index 9f4dc4c634223d7ff680c218d9755aec3279a4f6..371ffd26567b448adeb25f5f32d3a1d4e3a237ae 100644
--- a/browserid/static/dialog/test/qunit/browserid-network_test.js
+++ b/browserid/static/dialog/test/qunit/browserid-network_test.js
@@ -1,5 +1,5 @@
 /*jshint browsers:true, forin: true, laxbreak: true */
-/*global test: true, start: true, stop: true, module: true, ok: true, equal: true, BrowserIDNetwork: true */
+/*global test: true, start: true, stop: true, module: true, ok: true, equal: true, BrowserID: true */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
@@ -41,7 +41,7 @@
 steal.plugins("jquery", "funcunit/qunit").then("/dialog/resources/browserid-network", function() {
   "use strict";
 
-  var network = BrowserIDNetwork;
+  var network = BrowserID.Network;
   var xhr = {
     results: {
       "get /wsapi/csrf valid": "csrf_token", 
diff --git a/browserid/static/dialog/test/qunit/browserid-storage_unit_test.js b/browserid/static/dialog/test/qunit/browserid-storage_unit_test.js
index acd9d087c51235f32b5914cf117ca1a100272d32..323bbf9023eedf1f41f87d76ca2be40b6a06f942 100644
--- a/browserid/static/dialog/test/qunit/browserid-storage_unit_test.js
+++ b/browserid/static/dialog/test/qunit/browserid-storage_unit_test.js
@@ -1,5 +1,5 @@
 /*jshint browsers:true, forin: true, laxbreak: true */
-/*global steal: true, test: true, start: true, stop: true, module: true, ok: true, equal: true, BrowserIDStorage:true */
+/*global steal: true, test: true, start: true, stop: true, module: true, ok: true, equal: true, BrowserID:true */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
@@ -35,9 +35,9 @@
  *
  * ***** END LICENSE BLOCK ***** */
 steal.plugins("jquery", "funcunit/qunit").then("/dialog/resources/storage", function() {
-  var storage = BrowserIDStorage;
+  var storage = BrowserID.Storage;
 
-  module("BrowserIDStorage", {
+  module("BrowserID.Storage", {
     startup: function() {
       storage.clearEmails();
     },
diff --git a/browserid/static/dialog/test/qunit/qunit.js b/browserid/static/dialog/test/qunit/qunit.js
index 887b03c17ccc9d7fde9336c209b6da5523c41f28..1a898cc40875b5b7f5ef9fb74591c524d5e2dd6a 100644
--- a/browserid/static/dialog/test/qunit/qunit.js
+++ b/browserid/static/dialog/test/qunit/qunit.js
@@ -1,4 +1,5 @@
-steal("/dialog/resources/storage.js",
+steal("/dialog/resources/browserid.js",
+      "/dialog/resources/storage.js",
       "/dialog/resources/underscore-min.js")
   .plugins("funcunit/qunit")
   .then("browserid-storage_unit_test")
diff --git a/browserid/static/js/browserid.js b/browserid/static/js/browserid.js
index f6759e8d5286cc17a40a563499ba1057e37e8fae..a9226e5589efde80e9dbe237bc03927b1477f002 100644
--- a/browserid/static/js/browserid.js
+++ b/browserid/static/js/browserid.js
@@ -1,4 +1,4 @@
-/*globals BrowserIDNetwork: true, BrowserIDIdentities: true, _: true */
+/*globals BrowserID: true, _: true */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
@@ -56,7 +56,8 @@ $(function() {
 
   var token = getParameterByName("token"),
       path = document.location.pathname,
-      bid = BrowserID;
+      bid = BrowserID,
+      identities = bid.Identities;
 
   if (!path || path === "/") {
     bid.index();
@@ -81,12 +82,12 @@ $(function() {
   $(".signOut").click(function(event) {
     event.preventDefault();
 
-    BrowserIDIdentities.logoutUser(function() {
+    identities.logoutUser(function() {
       document.location = "/";
     });
   });
 
-  BrowserIDIdentities.checkAuthentication(function(authenticated) {
+  identities.checkAuthentication(function(authenticated) {
     if (authenticated) {
       $("#content").fadeIn("slow");
       if ($('#emailList').length) {
diff --git a/browserid/static/js/pages/add_email_address.js b/browserid/static/js/pages/add_email_address.js
index 7df3615cfb41274464aada2de58bce33c2ef35f7..9755ef018f3f368fa648408db52c96a754c469d3 100644
--- a/browserid/static/js/pages/add_email_address.js
+++ b/browserid/static/js/pages/add_email_address.js
@@ -1,4 +1,4 @@
-/*globals BrowserID: true, BrowserIDNetwork: true, $:true */
+/*globals BrowserID: true, $:true */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
@@ -51,7 +51,7 @@
   }
 
   BrowserID.addEmailAddress = function(token) {
-    BrowserIDNetwork.completeEmailRegistration(token, function onSuccess(valid) {
+    BrowserID.Network.completeEmailRegistration(token, function onSuccess(valid) {
       if (valid) {
         emailRegistrationSuccess();
       } else {
diff --git a/browserid/static/js/pages/manage_account.js b/browserid/static/js/pages/manage_account.js
index 500cbc43d9decda6013ecc0bc7d8bdcd80705a5b..491f4adf6e82434331eb3d8e5f64844cf87b7369 100644
--- a/browserid/static/js/pages/manage_account.js
+++ b/browserid/static/js/pages/manage_account.js
@@ -1,4 +1,4 @@
-/*globals BrowserID:true, BrowserIDNetwork: true, BrowserIDIdentities: true, _: true, confirm: true, syncAndDisplayEmails: true, displayEmails: true, onRemoveEmail: true*/
+/*globals BrowserID:true, _: true, confirm: true, syncAndDisplayEmails: true, displayEmails: true, onRemoveEmail: true*/
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
@@ -122,8 +122,8 @@
   function syncAndDisplayEmails() {
     var emails = {};
 
-    BrowserIDIdentities.syncEmailKeypairs(function() {
-      emails = BrowserIDIdentities.getStoredEmailKeypairs();
+    BrowserID.Identities.syncEmailKeypairs(function() {
+      emails = BrowserID.Identities.getStoredEmailKeypairs();
       if (_.isEmpty(emails)) {
         $("#content").hide();
       } else {
@@ -163,14 +163,14 @@
     event.preventDefault();
 
     if (confirm("Remove " + email + " from your BrowserID?")) {
-      BrowserIDIdentities.removeEmail(email, syncAndDisplayEmails);
+      BrowserID.Identities.removeEmail(email, syncAndDisplayEmails);
     }
   }
 
   BrowserID.manageAccount = function() {
     $('#cancellink').click(function() {
       if (confirm('Are you sure you want to cancel your account?')) {
-        BrowserIDNetwork.cancelUser(function() {
+        BrowserID.Network.cancelUser(function() {
           document.location="/";
         });
       }
diff --git a/browserid/static/js/pages/signin.js b/browserid/static/js/pages/signin.js
index 989c0da4ed029c67b15396a3e2095c106ef7499b..1afb9d305374daaf9bccbf6507a9abfb3bd1c840 100644
--- a/browserid/static/js/pages/signin.js
+++ b/browserid/static/js/pages/signin.js
@@ -1,4 +1,4 @@
-/*globals BrowserID:true, BrowserIDNetwork: true, $:true*/
+/*globals BrowserID:true, $:true*/
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
@@ -46,7 +46,7 @@
       var email = $("#email").val(),
           password = $("#password").val();
       
-      BrowserIDNetwork.authenticate(email, password, function onSuccess(authenticated) {
+      BrowserID.Network.authenticate(email, password, function onSuccess(authenticated) {
         if (authenticated) {
           document.location = "/";
         }
diff --git a/browserid/static/js/pages/signup.js b/browserid/static/js/pages/signup.js
index d4f8f9d3417740ace03ca1488a01f2ae4c40cf59..7cf7a3cf11cb1e462b8db1df8b3b7762adfca247 100644
--- a/browserid/static/js/pages/signup.js
+++ b/browserid/static/js/pages/signup.js
@@ -1,4 +1,4 @@
-/*globals BrowserID:true, BrowserIDIdentities: true, $:true*/
+/*globals BrowserID:true, $:true*/
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
@@ -56,7 +56,7 @@
 
 
     $(function () {
-      var identities = BrowserIDIdentities;
+      var identities = BrowserID.Identities;
 
       $("form input[autofocus]").focus();
 
diff --git a/browserid/static/js/pages/verify_email_address.js b/browserid/static/js/pages/verify_email_address.js
index 5315582c6657ce83dd7c842d3e99025cc0b10218..bef1c245558c29de543f2e2e5897ce1b65c4c939 100644
--- a/browserid/static/js/pages/verify_email_address.js
+++ b/browserid/static/js/pages/verify_email_address.js
@@ -1,4 +1,4 @@
-/*globals BrowserID:true, BrowserIDNetwork: true, $:true */
+/*globals BrowserID:true, $:true */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
@@ -46,7 +46,7 @@
           pass2 = $("#vpassword").val();
 
       if (pass && pass === pass2) {
-        BrowserIDNetwork.completeUserRegistration(token, pass, function onSuccess(registered) {
+        BrowserID.Network.completeUserRegistration(token, pass, function onSuccess(registered) {
           if (registered) {
             $("#congrats").fadeIn(250);
           }