(function() {
  'use strict';

  if (typeof window.fxpay === 'undefined') {
    window.fxpay = {};
  }

  window.fxpay.utils = {
    namespace: function() {
      var args = arguments;
      var ns = null;
      var parts;
      for (var i=0; i < args.length; i++) {
        ns = window;
        parts = args[i].split('.');
        // window is implied, so it is ignored if it is included
        for (var j=(parts[0] === 'window') ? 1 : 0; j < parts.length; j++) {
          ns[parts[j]] = ns[parts[j]] || {};
          ns = ns[parts[j]];
        }
      }
      return ns;
    }
  };
})();

@@ -150,118 +150,17 @@
 ion(
-) %7B%0A      var args = arguments;%0A      var ns = null;%0A      var parts;%0A      for (var i=0; i %3C args.length; i++
+namespace
 ) %7B%0A
@@ -161,25 +161,27 @@
 ce) %7B%0A      
- 
+var
  ns = window
@@ -188,17 +188,19 @@
 ;%0A      
- 
+var
  parts =
@@ -204,15 +204,17 @@
 s = 
-args%5Bi%5D
+namespace
 .spl
@@ -228,18 +228,16 @@
 ;%0A      
- 
- 
 // windo
@@ -285,18 +285,16 @@
 ncluded%0A
-  
       fo
@@ -356,26 +356,24 @@
 gth; j++) %7B%0A
-  
         ns%5Bp
@@ -411,18 +411,16 @@
         
-  
 ns = ns%5B
@@ -434,18 +434,8 @@
 %5D%5D;%0A
-        %7D%0A
     

Simplify namespace creation