text: var require = function (file, cwd) {
      var resolved = require.resolve(file, cwd || '/');
      var mod = require.modules[resolved];
      if (!mod) throw new Error(
          'Failed to resolve module ' + file + ', tried ' + resolved
      );
      var cached = require.cache[resolved];
      var res = cached? cached.exports : mod();
      return res;
  };
  
  require.paths = [];
  require.modules = {};
  require.cache = {};
  require.extensions = [".js",".coffee",".json"];
  
  require._core = {
      'assert': true,
      'events': true,
      'fs': true,
      'path': true,
      'vm': true
  };
  
  require.resolve = (function () {
      return function (x, cwd) {
          if (!cwd) cwd = '/';
          
          if (require._core[x]) return x;
          var path = require.modules.path();
          cwd = path.resolve('/', cwd);
          var y = cwd || '/';
          
          if (x.match(/^(?:\.\.?\/|\/)/)) {
              var m = loadAsFileSync(path.resolve(y, x))
                  || loadAsDirectorySync(path.resolve(y, x));
              if (m) return m;
          }
          
          var n = loadNodeModulesSync(x, y);
          if (n) return n;
          
          throw new Error("Cannot find module '" + x + "'");
          
          function loadAsFileSync (x) {
              x = path.normalize(x);
              if (require.modules[x]) {
                  return x;
              }
              
              for (var i = 0; i < require.extensions.length; i++) {
                  var ext = require.extensions[i];
                  if (require.modules[x + ext]) return x + ext;
              }
          }
          
          function loadAsDirectorySync (x) {
              x = x.replace(/\/+$/, '');
              var pkgfile = path.normalize(x + '/package.json');
              if (require.modules[pkgfile]) {
                  var pkg = require.modules[pkgfile]();
                  var b = pkg.browserify;
                  if (typeof b === 'object' && b.main) {
                      var m = loadAsFileSync(path.resolve(x, b.main));
                      if (m) return m;
                  }
                  else if (typeof b === 'string') {
                      var m = loadAsFileSync(path.resolve(x, b));
                      if (m) return m;
                  }
                  else if (pkg.main) {
                      var m = loadAsFileSync(path.resolve(x, pkg.main));
                      if (m) return m;
                  }
              }
              
              return loadAsFileSync(x + '/index');
          }
          
          function loadNodeModulesSync (x, start) {
              var dirs = nodeModulesPathsSync(start);
              for (var i = 0; i < dirs.length; i++) {
                  var dir = dirs[i];
                  var m = loadAsFileSync(dir + '/' + x);
                  if (m) return m;
                  var n = loadAsDirectorySync(dir + '/' + x);
                  if (n) return n;
              }
              
              var m = loadAsFileSync(x);
              if (m) return m;
          }
          
          function nodeModulesPathsSync (start) {
              var parts;
              if (start === '/') parts = [ '' ];
              else parts = path.normalize(start).split('/');
              
              var dirs = [];
              for (var i = parts.length - 1; i >= 0; i--) {
                  if (parts[i] === 'node_modules') continue;
                  var dir = parts.slice(0, i + 1).join('/') + '/node_modules';
                  dirs.push(dir);
              }
              
              return dirs;
          }
      };
  })();
  
  require.alias = function (from, to) {
      var path = require.modules.path();
      var res = null;
      try {
          res = require.resolve(from + '/package.json', '/');
      }
      catch (err) {
          res = require.resolve(from, '/');
      }
      var basedir = path.dirname(res);
      
      var keys = (Object.keys || function (obj) {
          var res = [];
          for (var key in obj) res.push(key);
          return res;
      })(require.modules);
      
      for (var i = 0; i < keys.length; i++) {
          var key = keys[i];
          if (key.slice(0, basedir.length + 1) === basedir + '/') {
              var f = key.slice(basedir.length);
              require.modules[to + f] = require.modules[basedir + f];
          }
          else if (key === basedir) {
              require.modules[to] = require.modules[basedir];
          }
      }
  };
  
  (function () {
      var process = {};
      var global = typeof window !== 'undefined' ? window : {};
      var definedProcess = false;
      
      require.define = function (filename, fn) {
          if (!definedProcess && require.modules.__browserify_process) {
              process = require.modules.__browserify_process();
              definedProcess = true;
          }
          
          var dirname = require._core[filename]
              ? ''
              : require.modules.path().dirname(filename)
          ;
          
          var require_ = function (file) {
              dirname = (dirname == ".") ? filename : dirname ;
              var requiredModule = require(file, dirname);
              var cached = require.cache[require.resolve(file, dirname)];
  
              if (cached && cached.parent === null) {
                  cached.parent = module_;
              }
  
              return requiredModule;
          };
          require_.resolve = function (name) {
              return require.resolve(name, dirname);
          };
          require_.modules = require.modules;
          require_.define = require.define;
          require_.cache = require.cache;
          var module_ = {
              id : filename,
              filename: filename,
              exports : {},
              loaded : false,
              parent: null
          };
          
          require.modules[filename] = function () {
              require.cache[filename] = module_;
              fn.call(
                  module_.exports,
                  require_,
                  module_,
                  module_.exports,
                  dirname,
                  filename,
                  process,
                  global
              );
              module_.loaded = true;
              return module_.exports;
          };
      };
  })();
  
  
  require.define("path",function(require,module,exports,__dirname,__filename,process,global){function filter (xs, fn) {
      var res = [];
      for (var i = 0; i < xs.length; i++) {
          if (fn(xs[i], i, xs)) res.push(xs[i]);
      }
      return res;
  }
  
  // resolves . and .. elements in a path array with directory names there
  // must be no slashes, empty elements, or device names (c:\) in the array
  // (so also no leading and trailing slashes - it does not distinguish
  // relative and absolute paths)
  function normalizeArray(parts, allowAboveRoot) {
    // if the path tries to go above the root, `up` ends up > 0
    var up = 0;
    for (var i = parts.length; i >= 0; i--) {
      var last = parts[i];
      if (last == '.') {
        parts.splice(i, 1);
      } else if (last === '..') {
        parts.splice(i, 1);
        up++;
      } else if (up) {
        parts.splice(i, 1);
        up--;
      }
    }
  
    // if the path is allowed to go above the root, restore leading ..s
    if (allowAboveRoot) {
      for (; up--; up) {
        parts.unshift('..');
      }
    }
  
    return parts;
  }
  
  // Regex to split a filename into [*, dir, basename, ext]
  // posix version
  var splitPathRe = /^(.+\/(?!$)|\/)?((?:.+?)?(\.[^.]*)?)$/;
  
  // path.resolve([from ...], to)
  // posix version
  exports.resolve = function() {
  var resolvedPath = '',
      resolvedAbsolute = false;
  
  for (var i = arguments.length; i >= -1 && !resolvedAbsolute; i--) {
    var path = (i >= 0)
        ? arguments[i]
        : process.cwd();
  
    // Skip empty and invalid entries
    if (typeof path !== 'string' || !path) {
      continue;
    }
  
    resolvedPath = path + '/' + resolvedPath;
    resolvedAbsolute = path.charAt(0) === '/';
  }
  
  // At this point the path should be resolved to a full absolute path, but
  // handle relative paths to be safe (might happen when process.cwd() fails)
  
  // Normalize the path
  resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
      return !!p;
    }), !resolvedAbsolute).join('/');
  
    return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
  };
  
  // path.normalize(path)
  // posix version
  exports.normalize = function(path) {
  var isAbsolute = path.charAt(0) === '/',
      trailingSlash = path.slice(-1) === '/';
  
  // Normalize the path
  path = normalizeArray(filter(path.split('/'), function(p) {
      return !!p;
    }), !isAbsolute).join('/');
  
    if (!path && !isAbsolute) {
      path = '.';
    }
    if (path && trailingSlash) {
      path += '/';
    }
    
    return (isAbsolute ? '/' : '') + path;
  };
  
  
  // posix version
  exports.join = function() {
    var paths = Array.prototype.slice.call(arguments, 0);
    return exports.normalize(filter(paths, function(p, index) {
      return p && typeof p === 'string';
    }).join('/'));
  };
  
  
  exports.dirname = function(path) {
    var dir = splitPathRe.exec(path)[1] || '';
    var isWindows = false;
    if (!dir) {
      // No dirname
      return '.';
    } else if (dir.length === 1 ||
        (isWindows && dir.length <= 3 && dir.charAt(1) === ':')) {
      // It is just a slash or a drive letter with a slash
      return dir;
    } else {
      // It is a full dirname, strip trailing slash
      return dir.substring(0, dir.length - 1);
    }
  };
  
  
  exports.basename = function(path, ext) {
    var f = splitPathRe.exec(path)[2] || '';
    // TODO: make this comparison case-insensitive on windows?
    if (ext && f.substr(-1 * ext.length) === ext) {
      f = f.substr(0, f.length - ext.length);
    }
    return f;
  };
  
  
  exports.extname = function(path) {
    return splitPathRe.exec(path)[3] || '';
  };
  
  });
  
  require.define("__browserify_process",function(require,module,exports,__dirname,__filename,process,global){var process = module.exports = {};
  
  process.nextTick = (function () {
      var canSetImmediate = typeof window !== 'undefined'
          && window.setImmediate;
      var canPost = typeof window !== 'undefined'
          && window.postMessage && window.addEventListener
      ;
  
      if (canSetImmediate) {
          return window.setImmediate;
      }
  
      if (canPost) {
          var queue = [];
          window.addEventListener('message', function (ev) {
              if (ev.source === window && ev.data === 'browserify-tick') {
                  ev.stopPropagation();
                  if (queue.length > 0) {
                      var fn = queue.shift();
                      fn();
                  }
              }
          }, true);
  
          return function nextTick(fn) {
              queue.push(fn);
              window.postMessage('browserify-tick', '*');
          };
      }
  
      return function nextTick(fn) {
          setTimeout(fn, 0);
      };
  })();
  
  process.title = 'browser';
  process.browser = true;
  process.env = {};
  process.argv = [];
  
  process.binding = function (name) {
      if (name === 'evals') return (require)('vm')
      else throw new Error('No such module. (Possibly not yet loaded)')
  };
  
  (function () {
      var cwd = '/';
      var path;
      process.cwd = function () { return cwd };
      process.chdir = function (dir) {
          if (!path) path = require('path');
          cwd = path.resolve(dir, cwd);
      };
  })();
  
  });
  
  require.define("/package.json",function(require,module,exports,__dirname,__filename,process,global){module.exports = {"main":"index.js"}
  });
  
  require.define("net",function(require,module,exports,__dirname,__filename,process,global){var net = module.exports;
  var events = require('events');
  var util = require('util');
  var Stream = require('stream');
  var Buffer = require('buffer').Buffer;
  
  var stringToArrayBuffer = function(str) {
    var buffer = new ArrayBuffer(str.length);
    var uint8Array = new Uint8Array(buffer);
    for(var i = 0; i < str.length; i++) {
      uint8Array[i] = str.charCodeAt(i);
    }
    return buffer;
  };
  
  var bufferToArrayBuffer = function(buffer) {
    return stringToArrayBuffer(buf.toString())
  };
  
  var arrayBufferToBuffer = function(arrayBuffer) {
    var buffer = new Buffer(arrayBuffer.byteLength);
    var uint8Array = new Uint8Array(arrayBuffer);
    for(var i = 0; i < uint8Array.length; i++) {
      buffer.writeUInt8(uint8Array[i], i);
    }
    return buffer;
  };
  
  net.createServer = function() {
    var options = {
    };
    var args = arguments;
  
    var cb = args[args.length -1];
    cb = (typeof cb === 'function') ? cb : function() {};
  
    if(typeof args[0] === 'object') {
      options = args[0];
    }
   
    var server = new net.Server(options);
    server.on("connection", cb);
    return server;
  };
  
  net.connect = net.createConnection = function() { 
    var options = {};
    var args = arguments;
    if(typeof args[0] === 'object') {
      options.port = args[0].port;
      options.host = args[0].host || "127.0.0.1";
    }
    else if(typeof args[0] === 'number') {
      // there is a port
      options.port = args[0];
      if(typeof args[1] === 'string') {
        options.host = args[1];
      }
    }
    else if(typeof args[0] === 'string') {
      return; // can't do this.
    }
  
    var cb = args[args.length -1];
    cb = (typeof cb === 'function') ? cb : function() {};
    
    var socket = new net.Socket(options, function() { 
      socket.connect(options, cb);
    });
    
    return socket;
  };
  
  net.Server = function() {
    var _maxConnections = 0;
    this.__defineGetter__("maxConnections", function() { return _maxConnections; });
    
    var _connections = 0;
    this.__defineGetter__("connections", function() { return _connections; });
  
    events.EventEmitter.call(this);
  };
  
  util.inherits(net.Server, events.EventEmitter);
  
  net.Server.prototype.listen = function() {
    var self = this;
    var options = {};
    var args = arguments;
    
    if (typeof args[0] === 'number') {
      // assume port. and host.
      options.port = args[0];
      options.host = "127.0.0.1";
      options.backlog = 511;
      if(typeof args[1] === 'string') {
        options.host = args[1];
      }
      else if(typeof args[1] === 'number') {
        options.backlog = args[1];
      }
      
      if(typeof args[2] === 'number') {
        options.backlog = args[2];
      }
    }
    else {
      // throw.
    }
  
    this._serverSocket = new net.Socket(options);
    
    var cb = args[args.length -1];
    cb = (typeof cb === 'function') ? cb : function() {};
    
    self.on('listening', cb);
  
    self._serverSocket.on("_created", function() {
      // Socket created, now turn it into a server socket.
      chrome.socket.listen(self._serverSocket._socketInfo.socketId, options.host, options.port, options.backlog, function() {
        self.emit('listening');
        chrome.socket.accept(self._serverSocket._socketInfo.socketId, self._accept.bind(self))
      }); 
    });
  };
  
  net.Server.prototype._accept = function(acceptInfo) {
    // Create a new socket for the handle the response.
    var self = this;
    var socket = new net.Socket();
    
    socket._socketInfo = acceptInfo;
    self.emit("connection", socket);
    chrome.socket.accept(self._serverSocket._socketInfo.socketId, self._accept.bind(self))
  };
  
  net.Server.prototype.close = function(callback) {
    self.on("close", callback || function() {});
    self._serverSocket.destroy();
    self.emit("close");
  };
  net.Server.prototype.address = function() {};
  
  net.Socket = function(options) {
    var self = this;
    options = options || {};
    this._fd = options.fd;
    this._type = options.type || "tcp";
    //assert(this._type === "tcp6", "Only tcp4 is allowed");
    //assert(this._type === "unix", "Only tcp4 is allowed");
    this._type = allowHalfOpen = options.allowHalfOpen || false;
    this._socketInfo = 0;
    this._encoding;
    
    chrome.socket.create("tcp", {}, function(createInfo) {
      self._socketInfo = createInfo;
      self.emit("_created"); // This event doesn't exist in the API, it is here because Chrome is async 
      // start trying to read
      self._read();
    });
  };
  
  util.inherits(net.Socket, Stream);
  
  /*
    Events:
      close
      connect
      data
      drain
      end
      error
      timeout
  */
  
  /*
    Methods
  */
  
  net.Socket.prototype.connect = function() {
    var self = this;
    var options = {};
    var args = arguments;
    
    if(typeof args[0] === 'object') {
      // we have an options object.
      options.port = args[0].port;
      options.host = args[0].host || "127.0.0.1";
    } 
    else if (typeof args[0] === 'string') {
      // throw an error, we can't do named pipes.
    }
    else if (typeof args[0] === 'number') {
      // assume port. and host.
      options.port = args[0];
      options.host = "127.0.0.1";
      if(typeof args[1] === 'string') {
        options.host = args[1];
      }
    }
  
    var cb = args[args.length -1];
    cb = (typeof cb === 'function') ? cb : function() {};
    self.on('connect', cb);
    
    chrome.socket.connect(self._socketInfo.socketId, options.host, options.port, function(result) {
      if(result == 0) {
        self.emit('connect');
      } 
      else {
        self.emit('error', new Error("Unable to connect"));
      }
    });
  };
  
  net.Socket.prototype.destroy = function() {
    chrome.socket.disconnect(this._socketInfo.socketId);
    chrome.socket.destroy(this._socketInfo.socketId);
  };
  net.Socket.prototype.destroySoon = function() {};
  net.Socket.prototype.setEncoding = function(encoding) {
    this._encoding = encoding;
  };
  
  net.Socket.prototype.setNoDelay = function(noDelay) {
    noDelay = (noDelay === undefined) ? true : noDelay;
    chrome.socket.setNoDely(self._socketInfo.socketId, noDelay, function() {});
  };
  
  net.Socket.prototype.setKeepAlive = function(enable, delay) {
    enable = (enable === 'undefined') ? false : enable;
    delay = (delay === 'undefined') ? 0 : delay;
    chrome.socket.setKeepAlive(self._socketInfo.socketId, enable, initialDelay, function() {});
  };
  
  net.Socket.prototype._read = function() {
    var self = this;
    chrome.socket.read(self._socketInfo.socketId, function(readInfo) {
      if(readInfo.resultCode < 0) return; 
      // ArrayBuffer to Buffer if no encoding.
      var buffer = arrayBufferToBuffer(readInfo.data);
      self.emit('data', buffer);
    });
  
    // enque another read soon. TODO: Is there are better way to controll speed.
    self._readTimer = setTimeout(self._read.bind(self), 100);
  }
  
  net.Socket.prototype.write = function(data, encoding, callback) {
    var buffer;
    var self = this;
    
    encoding = encoding || "UTF8";
    callback = callback || function() {};
  
    if(typeof data === 'string') {
      buffer = stringToArrayBuffer(data);
    }
    else if(data instanceof Buffer) {
      buffer = bufferToArrayBuffer(data);
    }
    else {
      // throw an error because we can't do anything.
    }
  
    self._resetTimeout();
  
    chrome.socket.write(self._socketInfo.socketId, buffer, function(writeInfo) {
      callback(); 
    });
  
    return true;
  };
  
  net.Socket.prototype._resetTimeout = function() {
    var self = this;
    if(!!self._timeout == false) clearTimeout(self._timeout);
    if(!!self._timeoutValue) self._timeout = setTimeout(function() { self.emit('timeout') }, self._timeoutValue);
  };
  
  net.Socket.prototype.setTimeout = function(timeout, callback) {
    this._timeoutValue = timeout;
    this._resetTimeout();
  };
  
  net.Socket.prototype.ref = function() {};
  net.Socket.prototype.unref = function() {};
  net.Socket.prototype.pause = function() {};
  net.Socket.prototype.resume = function() {};
  net.Socket.prototype.end = function() {
  
  };
  
  
  Object.defineProperty(net.Socket.prototype, 'readyState', {
    get: function() {}
  });
  
  Object.defineProperty(net.Socket.prototype, 'bufferSize', {
    get: function() {}
  });
  
  });
  
  require.define("events",function(require,module,exports,__dirname,__filename,process,global){if (!process.EventEmitter) process.EventEmitter = function () {};
  
  var EventEmitter = exports.EventEmitter = process.EventEmitter;
  var isArray = typeof Array.isArray === 'function'
      ? Array.isArray
      : function (xs) {
          return Object.prototype.toString.call(xs) === '[object Array]'
      }
  ;
  
  // By default EventEmitters will print a warning if more than
  // 10 listeners are added to it. This is a useful default which
  // helps finding memory leaks.
  //
  // Obviously not all Emitters should be limited to 10. This function allows
  // that to be increased. Set to zero for unlimited.
  var defaultMaxListeners = 10;
  EventEmitter.prototype.setMaxListeners = function(n) {
    if (!this._events) this._events = {};
    this._events.maxListeners = n;
  };
  
  
  EventEmitter.prototype.emit = function(type) {
    // If there is no 'error' event listener then throw.
    if (type === 'error') {
      if (!this._events || !this._events.error ||
          (isArray(this._events.error) && !this._events.error.length))
      {
        if (arguments[1] instanceof Error) {
          throw arguments[1]; // Unhandled 'error' event
        } else {
          throw new Error("Uncaught, unspecified 'error' event.");
        }
        return false;
      }
    }
  
    if (!this._events) return false;
    var handler = this._events[type];
    if (!handler) return false;
  
    if (typeof handler == 'function') {
      switch (arguments.length) {
        // fast cases
        case 1:
          handler.call(this);
          break;
        case 2:
          handler.call(this, arguments[1]);
          break;
        case 3:
          handler.call(this, arguments[1], arguments[2]);
          break;
        // slower
        default:
          var args = Array.prototype.slice.call(arguments, 1);
          handler.apply(this, args);
      }
      return true;
  
    } else if (isArray(handler)) {
      var args = Array.prototype.slice.call(arguments, 1);
  
      var listeners = handler.slice();
      for (var i = 0, l = listeners.length; i < l; i++) {
        listeners[i].apply(this, args);
      }
      return true;
  
    } else {
      return false;
    }
  };
  
  // EventEmitter is defined in src/node_events.cc
  // EventEmitter.prototype.emit() is also defined there.
  EventEmitter.prototype.addListener = function(type, listener) {
    if ('function' !== typeof listener) {
      throw new Error('addListener only takes instances of Function');
    }
  
    if (!this._events) this._events = {};
  
    // To avoid recursion in the case that type == "newListeners"! Before
    // adding it to the listeners, first emit "newListeners".
    this.emit('newListener', type, listener);
  
    if (!this._events[type]) {
      // Optimize the case of one listener. Don't need the extra array object.
      this._events[type] = listener;
    } else if (isArray(this._events[type])) {
  
      // Check for listener leak
      if (!this._events[type].warned) {
        var m;
        if (this._events.maxListeners !== undefined) {
          m = this._events.maxListeners;
        } else {
          m = defaultMaxListeners;
        }
  
        if (m && m > 0 && this._events[type].length > m) {
          this._events[type].warned = true;
          console.error('(node) warning: possible EventEmitter memory ' +
                        'leak detected. %d listeners added. ' +
                        'Use emitter.setMaxListeners() to increase limit.',
                        this._events[type].length);
          console.trace();
        }
      }
  
      // If we've already got an array, just append.
      this._events[type].push(listener);
    } else {
      // Adding the second element, need to change to array.
      this._events[type] = [this._events[type], listener];
    }
  
    return this;
  };
  
  EventEmitter.prototype.on = EventEmitter.prototype.addListener;
  
  EventEmitter.prototype.once = function(type, listener) {
    var self = this;
    self.on(type, function g() {
      self.removeListener(type, g);
      listener.apply(this, arguments);
    });
  
    return this;
  };
  
  EventEmitter.prototype.removeListener = function(type, listener) {
    if ('function' !== typeof listener) {
      throw new Error('removeListener only takes instances of Function');
    }
  
    // does not use listeners(), so no side effect of creating _events[type]
    if (!this._events || !this._events[type]) return this;
  
    var list = this._events[type];
  
    if (isArray(list)) {
      var i = list.indexOf(listener);
      if (i < 0) return this;
      list.splice(i, 1);
      if (list.length == 0)
        delete this._events[type];
    } else if (this._events[type] === listener) {
      delete this._events[type];
    }
  
    return this;
  };
  
  EventEmitter.prototype.removeAllListeners = function(type) {
    // does not use listeners(), so no side effect of creating _events[type]
    if (type && this._events && this._events[type]) this._events[type] = null;
    return this;
  };
  
  EventEmitter.prototype.listeners = function(type) {
    if (!this._events) this._events = {};
    if (!this._events[type]) this._events[type] = [];
    if (!isArray(this._events[type])) {
      this._events[type] = [this._events[type]];
    }
    return this._events[type];
  };
  
  });
  
  require.define("util",function(require,module,exports,__dirname,__filename,process,global){var events = require('events');
  
  exports.print = function () {};
  exports.puts = function () {};
  exports.debug = function() {};
  
  exports.inspect = function(obj, showHidden, depth, colors) {
    var seen = [];
  
    var stylize = function(str, styleType) {
      // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
      var styles =
          { 'bold' : [1, 22],
            'italic' : [3, 23],
            'underline' : [4, 24],
            'inverse' : [7, 27],
            'white' : [37, 39],
            'grey' : [90, 39],
            'black' : [30, 39],
            'blue' : [34, 39],
            'cyan' : [36, 39],
            'green' : [32, 39],
            'magenta' : [35, 39],
            'red' : [31, 39],
            'yellow' : [33, 39] };
  
      var style =
          { 'special': 'cyan',
            'number': 'blue',
            'boolean': 'yellow',
            'undefined': 'grey',
            'null': 'bold',
            'string': 'green',
            'date': 'magenta',
            // "name": intentionally not styling
            'regexp': 'red' }[styleType];
  
      if (style) {
        return '\033[' + styles[style][0] + 'm' + str +
               '\033[' + styles[style][1] + 'm';
      } else {
        return str;
      }
    };
    if (! colors) {
      stylize = function(str, styleType) { return str; };
    }
  
    function format(value, recurseTimes) {
      // Provide a hook for user-specified inspect functions.
      // Check that value is an object with an inspect function on it
      if (value && typeof value.inspect === 'function' &&
          // Filter out the util module, it's inspect function is special
          value !== exports &&
          // Also filter out any prototype objects using the circular check.
          !(value.constructor && value.constructor.prototype === value)) {
        return value.inspect(recurseTimes);
      }
  
      // Primitive types cannot have properties
      switch (typeof value) {
        case 'undefined':
          return stylize('undefined', 'undefined');
  
        case 'string':
          var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
                                                   .replace(/'/g, "\\'")
                                                   .replace(/\\"/g, '"') + '\'';
          return stylize(simple, 'string');
  
        case 'number':
          return stylize('' + value, 'number');
  
        case 'boolean':
          return stylize('' + value, 'boolean');
      }
      // For some reason typeof null is "object", so special case here.
      if (value === null) {
        return stylize('null', 'null');
      }
  
      // Look up the keys of the object.
      var visible_keys = Object_keys(value);
      var keys = showHidden ? Object_getOwnPropertyNames(value) : visible_keys;
  
      // Functions without properties can be shortcutted.
      if (typeof value === 'function' && keys.length === 0) {
        if (isRegExp(value)) {
          return stylize('' + value, 'regexp');
        } else {
          var name = value.name ? ': ' + value.name : '';
          return stylize('[Function' + name + ']', 'special');
        }
      }
  
      // Dates without properties can be shortcutted
      if (isDate(value) && keys.length === 0) {
        return stylize(value.toUTCString(), 'date');
      }
  
      var base, type, braces;
      // Determine the object type
      if (isArray(value)) {
        type = 'Array';
        braces = ['[', ']'];
      } else {
        type = 'Object';
        braces = ['{', '}'];
      }
  
      // Make functions say that they are functions
      if (typeof value === 'function') {
        var n = value.name ? ': ' + value.name : '';
        base = (isRegExp(value)) ? ' ' + value : ' [Function' + n + ']';
      } else {
        base = '';
      }
  
      // Make dates with properties first say the date
      if (isDate(value)) {
        base = ' ' + value.toUTCString();
      }
  
      if (keys.length === 0) {
        return braces[0] + base + braces[1];
      }
  
      if (recurseTimes < 0) {
        if (isRegExp(value)) {
          return stylize('' + value, 'regexp');
        } else {
          return stylize('[Object]', 'special');
        }
      }
  
      seen.push(value);
  
      var output = keys.map(function(key) {
        var name, str;
        if (value.__lookupGetter__) {
          if (value.__lookupGetter__(key)) {
            if (value.__lookupSetter__(key)) {
              str = stylize('[Getter/Setter]', 'special');
            } else {
              str = stylize('[Getter]', 'special');
            }
          } else {
            if (value.__lookupSetter__(key)) {
              str = stylize('[Setter]', 'special');
            }
          }
        }
        if (visible_keys.indexOf(key) < 0) {
          name = '[' + key + ']';
        }
        if (!str) {
          if (seen.indexOf(value[key]) < 0) {
            if (recurseTimes === null) {
              str = format(value[key]);
            } else {
              str = format(value[key], recurseTimes - 1);
            }
            if (str.indexOf('\n') > -1) {
              if (isArray(value)) {
                str = str.split('\n').map(function(line) {
                  return '  ' + line;
                }).join('\n').substr(2);
              } else {
                str = '\n' + str.split('\n').map(function(line) {
                  return '   ' + line;
                }).join('\n');
              }
            }
          } else {
            str = stylize('[Circular]', 'special');
          }
        }
        if (typeof name === 'undefined') {
          if (type === 'Array' && key.match(/^\d+$/)) {
            return str;
          }
          name = JSON.stringify('' + key);
          if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
            name = name.substr(1, name.length - 2);
            name = stylize(name, 'name');
          } else {
            name = name.replace(/'/g, "\\'")
                       .replace(/\\"/g, '"')
                       .replace(/(^"|"$)/g, "'");
            name = stylize(name, 'string');
          }
        }
  
        return name + ': ' + str;
      });
  
      seen.pop();
  
      var numLinesEst = 0;
      var length = output.reduce(function(prev, cur) {
        numLinesEst++;
        if (cur.indexOf('\n') >= 0) numLinesEst++;
        return prev + cur.length + 1;
      }, 0);
  
      if (length > 50) {
        output = braces[0] +
                 (base === '' ? '' : base + '\n ') +
                 ' ' +
                 output.join(',\n  ') +
                 ' ' +
                 braces[1];
  
      } else {
        output = braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
      }
  
      return output;
    }
    return format(obj, (typeof depth === 'undefined' ? 2 : depth));
  };
  
  
  function isArray(ar) {
    return ar instanceof Array ||
           Array.isArray(ar) ||
           (ar && ar !== Object.prototype && isArray(ar.__proto__));
  }
  
  
  function isRegExp(re) {
    return re instanceof RegExp ||
      (typeof re === 'object' && Object.prototype.toString.call(re) === '[object RegExp]');
  }
  
  
  function isDate(d) {
    if (d instanceof Date) return true;
    if (typeof d !== 'object') return false;
    var properties = Date.prototype && Object_getOwnPropertyNames(Date.prototype);
    var proto = d.__proto__ && Object_getOwnPropertyNames(d.__proto__);
    return JSON.stringify(proto) === JSON.stringify(properties);
  }
  
  function pad(n) {
    return n < 10 ? '0' + n.toString(10) : n.toString(10);
  }
  
  var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
                'Oct', 'Nov', 'Dec'];
  
  // 26 Feb 16:19:34
  function timestamp() {
    var d = new Date();
    var time = [pad(d.getHours()),
                pad(d.getMinutes()),
                pad(d.getSeconds())].join(':');
    return [d.getDate(), months[d.getMonth()], time].join(' ');
  }
  
  exports.log = function (msg) {};
  
  exports.pump = null;
  
  var Object_keys = Object.keys || function (obj) {
      var res = [];
      for (var key in obj) res.push(key);
      return res;
  };
  
  var Object_getOwnPropertyNames = Object.getOwnPropertyNames || function (obj) {
      var res = [];
      for (var key in obj) {
          if (Object.hasOwnProperty.call(obj, key)) res.push(key);
      }
      return res;
  };
  
  var Object_create = Object.create || function (prototype, properties) {
      // from es5-shim
      var object;
      if (prototype === null) {
          object = { '__proto__' : null };
      }
      else {
          if (typeof prototype !== 'object') {
              throw new TypeError(
                  'typeof prototype[' + (typeof prototype) + '] != \'object\''
              );
          }
          var Type = function () {};
          Type.prototype = prototype;
          object = new Type();
          object.__proto__ = prototype;
      }
      if (typeof properties !== 'undefined' && Object.defineProperties) {
          Object.defineProperties(object, properties);
      }
      return object;
  };
  
  exports.inherits = function(ctor, superCtor) {
    ctor.super_ = superCtor;
    ctor.prototype = Object_create(superCtor.prototype, {
      constructor: {
        value: ctor,
        enumerable: false,
        writable: true,
        configurable: true
      }
    });
  };
  
  var formatRegExp = /%[sdj%]/g;
  exports.format = function(f) {
    if (typeof f !== 'string') {
      var objects = [];
      for (var i = 0; i < arguments.length; i++) {
        objects.push(exports.inspect(arguments[i]));
      }
      return objects.join(' ');
    }
  
    var i = 1;
    var args = arguments;
    var len = args.length;
    var str = String(f).replace(formatRegExp, function(x) {
      if (x === '%%') return '%';
      if (i >= len) return x;
      switch (x) {
        case '%s': return String(args[i++]);
        case '%d': return Number(args[i++]);
        case '%j': return JSON.stringify(args[i++]);
        default:
          return x;
      }
    });
    for(var x = args[i]; i < len; x = args[++i]){
      if (x === null || typeof x !== 'object') {
        str += ' ' + x;
      } else {
        str += ' ' + exports.inspect(x);
      }
    }
    return str;
  };
  
  });
  
  require.define("stream",function(require,module,exports,__dirname,__filename,process,global){var events = require('events');
  var util = require('util');
  
  function Stream() {
    events.EventEmitter.call(this);
  }
  util.inherits(Stream, events.EventEmitter);
  module.exports = Stream;
  // Backwards-compat with node 0.4.x
  Stream.Stream = Stream;
  
  Stream.prototype.pipe = function(dest, options) {
    var source = this;
  
    function ondata(chunk) {
      if (dest.writable) {
        if (false === dest.write(chunk) && source.pause) {
          source.pause();
        }
      }
    }
  
    source.on('data', ondata);
  
    function ondrain() {
      if (source.readable && source.resume) {
        source.resume();
      }
    }
  
    dest.on('drain', ondrain);
  
    // If the 'end' option is not supplied, dest.end() will be called when
    // source gets the 'end' or 'close' events.  Only dest.end() once, and
    // only when all sources have ended.
    if (!dest._isStdio && (!options || options.end !== false)) {
      dest._pipeCount = dest._pipeCount || 0;
      dest._pipeCount++;
  
      source.on('end', onend);
      source.on('close', onclose);
    }
  
    var didOnEnd = false;
    function onend() {
      if (didOnEnd) return;
      didOnEnd = true;
  
      dest._pipeCount--;
  
      // remove the listeners
      cleanup();
  
      if (dest._pipeCount > 0) {
        // waiting for other incoming streams to end.
        return;
      }
  
      dest.end();
    }
  
  
    function onclose() {
      if (didOnEnd) return;
      didOnEnd = true;
  
      dest._pipeCount--;
  
      // remove the listeners
      cleanup();
  
      if (dest._pipeCount > 0) {
        // waiting for other incoming streams to end.
        return;
      }
  
      dest.destroy();
    }
  
    // don't leave dangling pipes when there are errors.
    function onerror(er) {
      cleanup();
      if (this.listeners('error').length === 0) {
        throw er; // Unhandled stream error in pipe.
      }
    }
  
    source.on('error', onerror);
    dest.on('error', onerror);
  
    // remove all the event listeners that were added.
    function cleanup() {
      source.removeListener('data', ondata);
      dest.removeListener('drain', ondrain);
  
      source.removeListener('end', onend);
      source.removeListener('close', onclose);
  
      source.removeListener('error', onerror);
      dest.removeListener('error', onerror);
  
      source.removeListener('end', cleanup);
      source.removeListener('close', cleanup);
  
      dest.removeListener('end', cleanup);
      dest.removeListener('close', cleanup);
    }
  
    source.on('end', cleanup);
    source.on('close', cleanup);
  
    dest.on('end', cleanup);
    dest.on('close', cleanup);
  
    dest.emit('pipe', source);
  
    // Allow for unix-like usage: A.pipe(B).pipe(C)
    return dest;
  };
  
  });
  
  require.define("buffer",function(require,module,exports,__dirname,__filename,process,global){module.exports = require("buffer-browserify")
  });
  
  require.define("/node_modules/buffer-browserify/package.json",function(require,module,exports,__dirname,__filename,process,global){module.exports = {"main":"index.js","browserify":"index.js"}
  });
  
  require.define("/node_modules/buffer-browserify/index.js",function(require,module,exports,__dirname,__filename,process,global){function SlowBuffer (size) {
      this.length = size;
  };
  
  var assert = require('assert');
  
  exports.INSPECT_MAX_BYTES = 50;
  
  
  function toHex(n) {
    if (n < 16) return '0' + n.toString(16);
    return n.toString(16);
  }
  
  function utf8ToBytes(str) {
    var byteArray = [];
    for (var i = 0; i < str.length; i++)
      if (str.charCodeAt(i) <= 0x7F)
        byteArray.push(str.charCodeAt(i));
      else {
        var h = encodeURIComponent(str.charAt(i)).substr(1).split('%');
        for (var j = 0; j < h.length; j++)
          byteArray.push(parseInt(h[j], 16));
      }
  
    return byteArray;
  }
  
  function asciiToBytes(str) {
    var byteArray = []
    for (var i = 0; i < str.length; i++ )
      // Node's code seems to be doing this and not & 0x7F..
      byteArray.push( str.charCodeAt(i) & 0xFF );
  
    return byteArray;
  }
  
  function base64ToBytes(str) {
    return require("base64-js").toByteArray(str);
  }
  
  SlowBuffer.byteLength = function (str, encoding) {
    switch (encoding || "utf8") {
      case 'hex':
        return str.length / 2;
  
      case 'utf8':
      case 'utf-8':
        return utf8ToBytes(str).length;
  
      case 'ascii':
        return str.length;
  
      case 'base64':
        return base64ToBytes(str).length;
  
      default:
        throw new Error('Unknown encoding');
    }
  };
  
  function blitBuffer(src, dst, offset, length) {
    var pos, i = 0;
    while (i < length) {
      if ((i+offset >= dst.length) || (i >= src.length))
        break;
  
      dst[i + offset] = src[i];
      i++;
    }
    return i;
  }
  
  SlowBuffer.prototype.utf8Write = function (string, offset, length) {
    var bytes, pos;
    return SlowBuffer._charsWritten =  blitBuffer(utf8ToBytes(string), this, offset, length);
  };
  
  SlowBuffer.prototype.asciiWrite = function (string, offset, length) {
    var bytes, pos;
    return SlowBuffer._charsWritten =  blitBuffer(asciiToBytes(string), this, offset, length);
  };
  
  SlowBuffer.prototype.base64Write = function (string, offset, length) {
    var bytes, pos;
    return SlowBuffer._charsWritten = blitBuffer(base64ToBytes(string), this, offset, length);
  };
  
  SlowBuffer.prototype.base64Slice = function (start, end) {
    var bytes = Array.prototype.slice.apply(this, arguments)
    return require("base64-js").fromByteArray(bytes);
  }
  
  function decodeUtf8Char(str) {
    try {
      return decodeURIComponent(str);
    } catch (err) {
      return String.fromCharCode(0xFFFD); // UTF 8 invalid char
    }
  }
  
  SlowBuffer.prototype.utf8Slice = function () {
    var bytes = Array.prototype.slice.apply(this, arguments);
    var res = "";
    var tmp = "";
    var i = 0;
    while (i < bytes.length) {
      if (bytes[i] <= 0x7F) {
        res += decodeUtf8Char(tmp) + String.fromCharCode(bytes[i]);
        tmp = "";
      } else
        tmp += "%" + bytes[i].toString(16);
  
      i++;
    }
  
    return res + decodeUtf8Char(tmp);
  }
  
  SlowBuffer.prototype.asciiSlice = function () {
    var bytes = Array.prototype.slice.apply(this, arguments);
    var ret = "";
    for (var i = 0; i < bytes.length; i++)
      ret += String.fromCharCode(bytes[i]);
    return ret;
  }
  
  SlowBuffer.prototype.inspect = function() {
    var out = [],
        len = this.length;
    for (var i = 0; i < len; i++) {
      out[i] = toHex(this[i]);
      if (i == exports.INSPECT_MAX_BYTES) {
        out[i + 1] = '...';
        break;
      }
    }
    return '<SlowBuffer ' + out.join(' ') + '>';
  };
  
  
  SlowBuffer.prototype.hexSlice = function(start, end) {
    var len = this.length;
  
    if (!start || start < 0) start = 0;
    if (!end || end < 0 || end > len) end = len;
  
    var out = '';
    for (var i = start; i < end; i++) {
      out += toHex(this[i]);
    }
    return out;
  };
  
  
  SlowBuffer.prototype.toString = function(encoding, start, end) {
    encoding = String(encoding || 'utf8').toLowerCase();
    start = +start || 0;
    if (typeof end == 'undefined') end = this.length;
  
    // Fastpath empty strings
    if (+end == start) {
      return '';
    }
  
    switch (encoding) {
      case 'hex':
        return this.hexSlice(start, end);
  
      case 'utf8':
      case 'utf-8':
        return this.utf8Slice(start, end);
  
      case 'ascii':
        return this.asciiSlice(start, end);
  
      case 'binary':
        return this.binarySlice(start, end);
  
      case 'base64':
        return this.base64Slice(start, end);
  
      case 'ucs2':
      case 'ucs-2':
        return this.ucs2Slice(start, end);
  
      default:
        throw new Error('Unknown encoding');
    }
  };
  
  
  SlowBuffer.prototype.hexWrite = function(string, offset, length) {
    offset = +offset || 0;
    var remaining = this.length - offset;
    if (!length) {
      length = remaining;
    } else {
      length = +length;
      if (length > remaining) {
        length = remaining;
      }
    }
  
    // must be an even number of digits
    var strLen = string.length;
    if (strLen % 2) {
      throw new Error('Invalid hex string');
    }
    if (length > strLen / 2) {
      length = strLen / 2;
    }
    for (var i = 0; i < length; i++) {
      var byte = parseInt(string.substr(i * 2, 2), 16);
      if (isNaN(byte)) throw new Error('Invalid hex string');
      this[offset + i] = byte;
    }
    SlowBuffer._charsWritten = i * 2;
    return i;
  };
  
  
  SlowBuffer.prototype.write = function(string, offset, length, encoding) {
    // Support both (string, offset, length, encoding)
    // and the legacy (string, encoding, offset, length)
    if (isFinite(offset)) {
      if (!isFinite(length)) {
        encoding = length;
        length = undefined;
      }
    } else {  // legacy
      var swap = encoding;
      encoding = offset;
      offset = length;
      length = swap;
    }
  
    offset = +offset || 0;
    var remaining = this.length - offset;
    if (!length) {
      length = remaining;
    } else {
      length = +length;
      if (length > remaining) {
        length = remaining;
      }
    }
    encoding = String(encoding || 'utf8').toLowerCase();
  
    switch (encoding) {
      case 'hex':
        return this.hexWrite(string, offset, length);
  
      case 'utf8':
      case 'utf-8':
        return this.utf8Write(string, offset, length);
  
      case 'ascii':
        return this.asciiWrite(string, offset, length);
  
      case 'binary':
        return this.binaryWrite(string, offset, length);
  
      case 'base64':
        return this.base64Write(string, offset, length);
  
      case 'ucs2':
      case 'ucs-2':
        return this.ucs2Write(string, offset, length);
  
      default:
        throw new Error('Unknown encoding');
    }
  };
  
  
  // slice(start, end)
  SlowBuffer.prototype.slice = function(start, end) {
    if (end === undefined) end = this.length;
  
    if (end > this.length) {
      throw new Error('oob');
    }
    if (start > end) {
      throw new Error('oob');
    }
  
    return new Buffer(this, end - start, +start);
  };
  
  
  function coerce(length) {
    // Coerce length to a number (possibly NaN), round up
    // in case it's fractional (e.g. 123.456) then do a
    // double negate to coerce a NaN to 0. Easy, right?
    length = ~~Math.ceil(+length);
    return length < 0 ? 0 : length;
  }
  
  
  // Buffer
  
  function Buffer(subject, encoding, offset) {
    if (!(this instanceof Buffer)) {
      return new Buffer(subject, encoding, offset);
    }
  
    var type;
  
    // Are we slicing?
    if (typeof offset === 'number') {
      this.length = coerce(encoding);
      this.parent = subject;
      this.offset = offset;
    } else {
      // Find the length
      switch (type = typeof subject) {
        case 'number':
          this.length = coerce(subject);
          break;
  
        case 'string':
          this.length = Buffer.byteLength(subject, encoding);
          break;
  
        case 'object': // Assume object is an array
          this.length = coerce(subject.length);
          break;
  
        default:
          throw new Error('First argument needs to be a number, ' +
                          'array or string.');
      }
  
      if (this.length > Buffer.poolSize) {
        // Big buffer, just alloc one.
        this.parent = new SlowBuffer(this.length);
        this.offset = 0;
  
      } else {
        // Small buffer.
        if (!pool || pool.length - pool.used < this.length) allocPool();
        this.parent = pool;
        this.offset = pool.used;
        pool.used += this.length;
      }
  
      // Treat array-ish objects as a byte array.
      if (isArrayIsh(subject)) {
        for (var i = 0; i < this.length; i++) {
          this.parent[i + this.offset] = subject[i];
        }
      } else if (type == 'string') {
        // We are a string
        this.length = this.write(subject, 0, encoding);
      }
    }
  
  }
  
  function isArrayIsh(subject) {
    return Array.isArray(subject) || Buffer.isBuffer(subject) ||
           subject && typeof subject === 'object' &&
           typeof subject.length === 'number';
  }
  
  exports.SlowBuffer = SlowBuffer;
  exports.Buffer = Buffer;
  
  Buffer.poolSize = 8 * 1024;
  var pool;
  
  function allocPool() {
    pool = new SlowBuffer(Buffer.poolSize);
    pool.used = 0;
  }
  
  
  // Static methods
  Buffer.isBuffer = function isBuffer(b) {
    return b instanceof Buffer || b instanceof SlowBuffer;
  };
  
  
  // Inspect
  Buffer.prototype.inspect = function inspect() {
    var out = [],
        len = this.length;
  
    for (var i = 0; i < len; i++) {
      out[i] = toHex(this.parent[i + this.offset]);
      if (i == exports.INSPECT_MAX_BYTES) {
        out[i + 1] = '...';
        break;
      }
    }
  
    return '<Buffer ' + out.join(' ') + '>';
  };
  
  
  Buffer.prototype.get = function get(i) {
    if (i < 0 || i >= this.length) throw new Error('oob');
    return this.parent[this.offset + i];
  };
  
  
  Buffer.prototype.set = function set(i, v) {
    if (i < 0 || i >= this.length) throw new Error('oob');
    return this.parent[this.offset + i] = v;
  };
  
  
  // write(string, offset = 0, length = buffer.length-offset, encoding = 'utf8')
  Buffer.prototype.write = function(string, offset, length, encoding) {
    // Support both (string, offset, length, encoding)
    // and the legacy (string, encoding, offset, length)
    if (isFinite(offset)) {
      if (!isFinite(length)) {
        encoding = length;
        length = undefined;
      }
    } else {  // legacy
      var swap = encoding;
      encoding = offset;
      offset = length;
      length = swap;
    }
  
    offset = +offset || 0;
    var remaining = this.length - offset;
    if (!length) {
      length = remaining;
    } else {
      length = +length;
      if (length > remaining) {
        length = remaining;
      }
    }
    encoding = String(encoding || 'utf8').toLowerCase();
  
    var ret;
    switch (encoding) {
      case 'hex':
        ret = this.parent.hexWrite(string, this.offset + offset, length);
        break;
  
      case 'utf8':
      case 'utf-8':
        ret = this.parent.utf8Write(string, this.offset + offset, length);
        break;
  
      case 'ascii':
        ret = this.parent.asciiWrite(string, this.offset + offset, length);
        break;
  
      case 'binary':
        ret = this.parent.binaryWrite(string, this.offset + offset, length);
        break;
  
      case 'base64':
        // Warning: maxLength not taken into account in base64Write
        ret = this.parent.base64Write(string, this.offset + offset, length);
        break;
  
      case 'ucs2':
      case 'ucs-2':
        ret = this.parent.ucs2Write(string, this.offset + offset, length);
        break;
  
      default:
        throw new Error('Unknown encoding');
    }
  
    Buffer._charsWritten = SlowBuffer._charsWritten;
  
    return ret;
  };
  
  
  // toString(encoding, start=0, end=buffer.length)
  Buffer.prototype.toString = function(encoding, start, end) {
    encoding = String(encoding || 'utf8').toLowerCase();
  
    if (typeof start == 'undefined' || start < 0) {
      start = 0;
    } else if (start > this.length) {
      start = this.length;
    }
  
    if (typeof end == 'undefined' || end > this.length) {
      end = this.length;
    } else if (end < 0) {
      end = 0;
    }
  
    start = start + this.offset;
    end = end + this.offset;
  
    switch (encoding) {
      case 'hex':
        return this.parent.hexSlice(start, end);
  
      case 'utf8':
      case 'utf-8':
        return this.parent.utf8Slice(start, end);
  
      case 'ascii':
        return this.parent.asciiSlice(start, end);
  
      case 'binary':
        return this.parent.binarySlice(start, end);
  
      case 'base64':
        return this.parent.base64Slice(start, end);
  
      case 'ucs2':
      case 'ucs-2':
        return this.parent.ucs2Slice(start, end);
  
      default:
        throw new Error('Unknown encoding');
    }
  };
  
  
  // byteLength
  Buffer.byteLength = SlowBuffer.byteLength;
  
  
  // fill(value, start=0, end=buffer.length)
  Buffer.prototype.fill = function fill(value, start, end) {
    value || (value = 0);
    start || (start = 0);
    end || (end = this.length);
  
    if (typeof value === 'string') {
      value = value.charCodeAt(0);
    }
    if (!(typeof value === 'number') || isNaN(value)) {
      throw new Error('value is not a number');
    }
  
    if (end < start) throw new Error('end < start');
  
    // Fill 0 bytes; we're done
    if (end === start) return 0;
    if (this.length == 0) return 0;
  
    if (start < 0 || start >= this.length) {
      throw new Error('start out of bounds');
    }
  
    if (end < 0 || end > this.length) {
      throw new Error('end out of bounds');
    }
  
    return this.parent.fill(value,
                            start + this.offset,
                            end + this.offset);
  };
  
  
  // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
  Buffer.prototype.copy = function(target, target_start, start, end) {
    var source = this;
    start || (start = 0);
    end || (end = this.length);
    target_start || (target_start = 0);
  
    if (end < start) throw new Error('sourceEnd < sourceStart');
  
    // Copy 0 bytes; we're done
    if (end === start) return 0;
    if (target.length == 0 || source.length == 0) return 0;
  
    if (target_start < 0 || target_start >= target.length) {
      throw new Error('targetStart out of bounds');
    }
  
    if (start < 0 || start >= source.length) {
      throw new Error('sourceStart out of bounds');
    }
  
    if (end < 0 || end > source.length) {
      throw new Error('sourceEnd out of bounds');
    }
  
    // Are we oob?
    if (end > this.length) {
      end = this.length;
    }
  
    if (target.length - target_start < end - start) {
      end = target.length - target_start + start;
    }
  
    return this.parent.copy(target.parent,
                            target_start + target.offset,
                            start + this.offset,
                            end + this.offset);
  };
  
  
  // slice(start, end)
  Buffer.prototype.slice = function(start, end) {
    if (end === undefined) end = this.length;
    if (end > this.length) throw new Error('oob');
    if (start > end) throw new Error('oob');
  
    return new Buffer(this.parent, end - start, +start + this.offset);
  };
  
  
  // Legacy methods for backwards compatibility.
  
  Buffer.prototype.utf8Slice = function(start, end) {
    return this.toString('utf8', start, end);
  };
  
  Buffer.prototype.binarySlice = function(start, end) {
    return this.toString('binary', start, end);
  };
  
  Buffer.prototype.asciiSlice = function(start, end) {
    return this.toString('ascii', start, end);
  };
  
  Buffer.prototype.utf8Write = function(string, offset) {
    return this.write(string, offset, 'utf8');
  };
  
  Buffer.prototype.binaryWrite = function(string, offset) {
    return this.write(string, offset, 'binary');
  };
  
  Buffer.prototype.asciiWrite = function(string, offset) {
    return this.write(string, offset, 'ascii');
  };
  
  Buffer.prototype.readUInt8 = function(offset, noAssert) {
    var buffer = this;
  
    if (!noAssert) {
      assert.ok(offset !== undefined && offset !== null,
          'missing offset');
  
      assert.ok(offset < buffer.length,
          'Trying to read beyond buffer length');
    }
  
    return buffer[offset];
  };
  
  function readUInt16(buffer, offset, isBigEndian, noAssert) {
    var val = 0;
  
  
    if (!noAssert) {
      assert.ok(typeof (isBigEndian) === 'boolean',
          'missing or invalid endian');
  
      assert.ok(offset !== undefined && offset !== null,
          'missing offset');
  
      assert.ok(offset + 1 < buffer.length,
          'Trying to read beyond buffer length');
    }
  
    if (isBigEndian) {
      val = buffer[offset] << 8;
      val |= buffer[offset + 1];
    } else {
      val = buffer[offset];
      val |= buffer[offset + 1] << 8;
    }
  
    return val;
  }
  
  Buffer.prototype.readUInt16LE = function(offset, noAssert) {
    return readUInt16(this, offset, false, noAssert);
  };
  
  Buffer.prototype.readUInt16BE = function(offset, noAssert) {
    return readUInt16(this, offset, true, noAssert);
  };
  
  function readUInt32(buffer, offset, isBigEndian, noAssert) {
    var val = 0;
  
    if (!noAssert) {
      assert.ok(typeof (isBigEndian) === 'boolean',
          'missing or invalid endian');
  
      assert.ok(offset !== undefined && offset !== null,
          'missing offset');
  
      assert.ok(offset + 3 < buffer.length,
          'Trying to read beyond buffer length');
    }
  
    if (isBigEndian) {
      val = buffer[offset + 1] << 16;
      val |= buffer[offset + 2] << 8;
      val |= buffer[offset + 3];
      val = val + (buffer[offset] << 24 >>> 0);
    } else {
      val = buffer[offset + 2] << 16;
      val |= buffer[offset + 1] << 8;
      val |= buffer[offset];
      val = val + (buffer[offset + 3] << 24 >>> 0);
    }
  
    return val;
  }
  
  Buffer.prototype.readUInt32LE = function(offset, noAssert) {
    return readUInt32(this, offset, false, noAssert);
  };
  
  Buffer.prototype.readUInt32BE = function(offset, noAssert) {
    return readUInt32(this, offset, true, noAssert);
  };
  
  
  /*
   * Signed integer types, yay team! A reminder on how two's complement actually
   * works. The first bit is the signed bit, i.e. tells us whether or not the
   * number should be positive or negative. If the two's complement value is
   * positive, then we're done, as it's equivalent to the unsigned representation.
   *
   * Now if the number is positive, you're pretty much done, you can just leverage
   * the unsigned translations and return those. Unfortunately, negative numbers
   * aren't quite that straightforward.
   *
   * At first glance, one might be inclined to use the traditional formula to
   * translate binary numbers between the positive and negative values in two's
   * complement. (Though it doesn't quite work for the most negative value)
   * Mainly:
   *  - invert all the bits
   *  - add one to the result
   *
   * Of course, this doesn't quite work in Javascript. Take for example the value
   * of -128. This could be represented in 16 bits (big-endian) as 0xff80. But of
   * course, Javascript will do the following:
   *
   * > ~0xff80
   * -65409
   *
   * Whoh there, Javascript, that's not quite right. But wait, according to
   * Javascript that's perfectly correct. When Javascript ends up seeing the
   * constant 0xff80, it has no notion that it is actually a signed number. It
   * assumes that we've input the unsigned value 0xff80. Thus, when it does the
   * binary negation, it casts it into a signed value, (positive 0xff80). Then
   * when you perform binary negation on that, it turns it into a negative number.
   *
   * Instead, we're going to have to use the following general formula, that works
   * in a rather Javascript friendly way. I'm glad we don't support this kind of
   * weird numbering scheme in the kernel.
   *
   * (BIT-MAX - (unsigned)val + 1) * -1
   *
   * The astute observer, may think that this doesn't make sense for 8-bit numbers
   * (really it isn't necessary for them). However, when you get 16-bit numbers,
   * you do. Let's go back to our prior example and see how this will look:
   *
   * (0xffff - 0xff80 + 1) * -1
   * (0x007f + 1) * -1
   * (0x0080) * -1
   */
  Buffer.prototype.readInt8 = function(offset, noAssert) {
    var buffer = this;
    var neg;
  
    if (!noAssert) {
      assert.ok(offset !== undefined && offset !== null,
          'missing offset');
  
      assert.ok(offset < buffer.length,
          'Trying to read beyond buffer length');
    }
  
    neg = buffer[offset] & 0x80;
    if (!neg) {
      return (buffer[offset]);
    }
  
    return ((0xff - buffer[offset] + 1) * -1);
  };
  
  function readInt16(buffer, offset, isBigEndian, noAssert) {
    var neg, val;
  
    if (!noAssert) {
      assert.ok(typeof (isBigEndian) === 'boolean',
          'missing or invalid endian');
  
      assert.ok(offset !== undefined && offset !== null,
          'missing offset');
  
      assert.ok(offset + 1 < buffer.length,
          'Trying to read beyond buffer length');
    }
  
    val = readUInt16(buffer, offset, isBigEndian, noAssert);
    neg = val & 0x8000;
    if (!neg) {
      return val;
    }
  
    return (0xffff - val + 1) * -1;
  }
  
  Buffer.prototype.readInt16LE = function(offset, noAssert) {
    return readInt16(this, offset, false, noAssert);
  };
  
  Buffer.prototype.readInt16BE = function(offset, noAssert) {
    return readInt16(this, offset, true, noAssert);
  };
  
  function readInt32(buffer, offset, isBigEndian, noAssert) {
    var neg, val;
  
    if (!noAssert) {
      assert.ok(typeof (isBigEndian) === 'boolean',
          'missing or invalid endian');
  
      assert.ok(offset !== undefined && offset !== null,
          'missing offset');
  
      assert.ok(offset + 3 < buffer.length,
          'Trying to read beyond buffer length');
    }
  
    val = readUInt32(buffer, offset, isBigEndian, noAssert);
    neg = val & 0x80000000;
    if (!neg) {
      return (val);
    }
  
    return (0xffffffff - val + 1) * -1;
  }
  
  Buffer.prototype.readInt32LE = function(offset, noAssert) {
    return readInt32(this, offset, false, noAssert);
  };
  
  Buffer.prototype.readInt32BE = function(offset, noAssert) {
    return readInt32(this, offset, true, noAssert);
  };
  
  function readFloat(buffer, offset, isBigEndian, noAssert) {
    if (!noAssert) {
      assert.ok(typeof (isBigEndian) === 'boolean',
          'missing or invalid endian');
  
      assert.ok(offset + 3 < buffer.length,
          'Trying to read beyond buffer length');
    }
  
    return require('./buffer_ieee754').readIEEE754(buffer, offset, isBigEndian,
        23, 4);
  }
  
  Buffer.prototype.readFloatLE = function(offset, noAssert) {
    return readFloat(this, offset, false, noAssert);
  };
  
  Buffer.prototype.readFloatBE = function(offset, noAssert) {
    return readFloat(this, offset, true, noAssert);
  };
  
  function readDouble(buffer, offset, isBigEndian, noAssert) {
    if (!noAssert) {
      assert.ok(typeof (isBigEndian) === 'boolean',
          'missing or invalid endian');
  
      assert.ok(offset + 7 < buffer.length,
          'Trying to read beyond buffer length');
    }
  
    return require('./buffer_ieee754').readIEEE754(buffer, offset, isBigEndian,
        52, 8);
  }
  
  Buffer.prototype.readDoubleLE = function(offset, noAssert) {
    return readDouble(this, offset, false, noAssert);
  };
  
  Buffer.prototype.readDoubleBE = function(offset, noAssert) {
    return readDouble(this, offset, true, noAssert);
  };
  
  
  /*
   * We have to make sure that the value is a valid integer. This means that it is
   * non-negative. It has no fractional component and that it does not exceed the
   * maximum allowed value.
   *
   *      value           The number to check for validity
   *
   *      max             The maximum value
   */
  function verifuint(value, max) {
    assert.ok(typeof (value) == 'number',
        'cannot write a non-number as a number');
  
    assert.ok(value >= 0,
        'specified a negative value for writing an unsigned value');
  
    assert.ok(value <= max, 'value is larger than maximum value for type');
  
    assert.ok(Math.floor(value) === value, 'value has a fractional component');
  }
  
  Buffer.prototype.writeUInt8 = function(value, offset, noAssert) {
    var buffer = this;
  
    if (!noAssert) {
      assert.ok(value !== undefined && value !== null,
          'missing value');
  
      assert.ok(offset !== undefined && offset !== null,
          'missing offset');
  
      assert.ok(offset < buffer.length,
          'trying to write beyond buffer length');
  
      verifuint(value, 0xff);
    }
  
    buffer.parent[buffer.offset + offset] = value;
  };
  
  function writeUInt16(buffer, value, offset, isBigEndian, noAssert) {
    if (!noAssert) {
      assert.ok(value !== undefined && value !== null,
          'missing value');
  
      assert.ok(typeof (isBigEndian) === 'boolean',
          'missing or invalid endian');
  
      assert.ok(offset !== undefined && offset !== null,
          'missing offset');
  
      assert.ok(offset + 1 < buffer.length,
          'trying to write beyond buffer length');
  
      verifuint(value, 0xffff);
    }
  
    if (isBigEndian) {
      buffer.parent[buffer.offset + offset] = (value & 0xff00) >>> 8;
      buffer.parent[buffer.offset + offset + 1] = value & 0x00ff;
    } else {
      buffer.parent[buffer.offset + offset + 1] = (value & 0xff00) >>> 8;
      buffer.parent[buffer.offset + offset] = value & 0x00ff;
    }
  }
  
  Buffer.prototype.writeUInt16LE = function(value, offset, noAssert) {
    writeUInt16(this, value, offset, false, noAssert);
  };
  
  Buffer.prototype.writeUInt16BE = function(value, offset, noAssert) {
    writeUInt16(this, value, offset, true, noAssert);
  };
  
  function writeUInt32(buffer, value, offset, isBigEndian, noAssert) {
    if (!noAssert) {
      assert.ok(value !== undefined && value !== null,
          'missing value');
  
      assert.ok(typeof (isBigEndian) === 'boolean',
          'missing or invalid endian');
  
      assert.ok(offset !== undefined && offset !== null,
          'missing offset');
  
      assert.ok(offset + 3 < buffer.length,
          'trying to write beyond buffer length');
  
      verifuint(value, 0xffffffff);
    }
  
    if (isBigEndian) {
      buffer.parent[buffer.offset + offset] = (value >>> 24) & 0xff;
      buffer.parent[buffer.offset + offset + 1] = (value >>> 16) & 0xff;
      buffer.parent[buffer.offset + offset + 2] = (value >>> 8) & 0xff;
      buffer.parent[buffer.offset + offset + 3] = value & 0xff;
    } else {
      buffer.parent[buffer.offset + offset + 3] = (value >>> 24) & 0xff;
      buffer.parent[buffer.offset + offset + 2] = (value >>> 16) & 0xff;
      buffer.parent[buffer.offset + offset + 1] = (value >>> 8) & 0xff;
      buffer.parent[buffer.offset + offset] = value & 0xff;
    }
  }
  
  Buffer.prototype.writeUInt32LE = function(value, offset, noAssert) {
    writeUInt32(this, value, offset, false, noAssert);
  };
  
  Buffer.prototype.writeUInt32BE = function(value, offset, noAssert) {
    writeUInt32(this, value, offset, true, noAssert);
  };
  
  
  /*
   * We now move onto our friends in the signed number category. Unlike unsigned
   * numbers, we're going to have to worry a bit more about how we put values into
   * arrays. Since we are only worrying about signed 32-bit values, we're in
   * slightly better shape. Unfortunately, we really can't do our favorite binary
   * & in this system. It really seems to do the wrong thing. For example:
   *
   * > -32 & 0xff
   * 224
   *
   * What's happening above is really: 0xe0 & 0xff = 0xe0. However, the results of
   * this aren't treated as a signed number. Ultimately a bad thing.
   *
   * What we're going to want to do is basically create the unsigned equivalent of
   * our representation and pass that off to the wuint* functions. To do that
   * we're going to do the following:
   *
   *  - if the value is positive
   *      we can pass it directly off to the equivalent wuint
   *  - if the value is negative
   *      we do the following computation:
   *         mb + val + 1, where
   *         mb   is the maximum unsigned value in that byte size
   *         val  is the Javascript negative integer
   *
   *
   * As a concrete value, take -128. In signed 16 bits this would be 0xff80. If
   * you do out the computations:
   *
   * 0xffff - 128 + 1
   * 0xffff - 127
   * 0xff80
   *
   * You can then encode this value as the signed version. This is really rather
   * hacky, but it should work and get the job done which is our goal here.
   */
  
  /*
   * A series of checks to make sure we actually have a signed 32-bit number
   */
  function verifsint(value, max, min) {
    assert.ok(typeof (value) == 'number',
        'cannot write a non-number as a number');
  
    assert.ok(value <= max, 'value larger than maximum allowed value');
  
    assert.ok(value >= min, 'value smaller than minimum allowed value');
  
    assert.ok(Math.floor(value) === value, 'value has a fractional component');
  }
  
  function verifIEEE754(value, max, min) {
    assert.ok(typeof (value) == 'number',
        'cannot write a non-number as a number');
  
    assert.ok(value <= max, 'value larger than maximum allowed value');
  
    assert.ok(value >= min, 'value smaller than minimum allowed value');
  }
  
  Buffer.prototype.writeInt8 = function(value, offset, noAssert) {
    var buffer = this;
  
    if (!noAssert) {
      assert.ok(value !== undefined && value !== null,
          'missing value');
  
      assert.ok(offset !== undefined && offset !== null,
          'missing offset');
  
      assert.ok(offset < buffer.length,
          'Trying to write beyond buffer length');
  
      verifsint(value, 0x7f, -0x80);
    }
  
    if (value >= 0) {
      buffer.writeUInt8(value, offset, noAssert);
    } else {
      buffer.writeUInt8(0xff + value + 1, offset, noAssert);
    }
  };
  
  function writeInt16(buffer, value, offset, isBigEndian, noAssert) {
    if (!noAssert) {
      assert.ok(value !== undefined && value !== null,
          'missing value');
  
      assert.ok(typeof (isBigEndian) === 'boolean',
          'missing or invalid endian');
  
      assert.ok(offset !== undefined && offset !== null,
          'missing offset');
  
      assert.ok(offset + 1 < buffer.length,
          'Trying to write beyond buffer length');
  
      verifsint(value, 0x7fff, -0x8000);
    }
  
    if (value >= 0) {
      writeUInt16(buffer, value, offset, isBigEndian, noAssert);
    } else {
      writeUInt16(buffer, 0xffff + value + 1, offset, isBigEndian, noAssert);
    }
  }
  
  Buffer.prototype.writeInt16LE = function(value, offset, noAssert) {
    writeInt16(this, value, offset, false, noAssert);
  };
  
  Buffer.prototype.writeInt16BE = function(value, offset, noAssert) {
    writeInt16(this, value, offset, true, noAssert);
  };
  
  function writeInt32(buffer, value, offset, isBigEndian, noAssert) {
    if (!noAssert) {
      assert.ok(value !== undefined && value !== null,
          'missing value');
  
      assert.ok(typeof (isBigEndian) === 'boolean',
          'missing or invalid endian');
  
      assert.ok(offset !== undefined && offset !== null,
          'missing offset');
  
      assert.ok(offset + 3 < buffer.length,
          'Trying to write beyond buffer length');
  
      verifsint(value, 0x7fffffff, -0x80000000);
    }
  
    if (value >= 0) {
      writeUInt32(buffer, value, offset, isBigEndian, noAssert);
    } else {
      writeUInt32(buffer, 0xffffffff + value + 1, offset, isBigEndian, noAssert);
    }
  }
  
  Buffer.prototype.writeInt32LE = function(value, offset, noAssert) {
    writeInt32(this, value, offset, false, noAssert);
  };
  
  Buffer.prototype.writeInt32BE = function(value, offset, noAssert) {
    writeInt32(this, value, offset, true, noAssert);
  };
  
  function writeFloat(buffer, value, offset, isBigEndian, noAssert) {
    if (!noAssert) {
      assert.ok(value !== undefined && value !== null,
          'missing value');
  
      assert.ok(typeof (isBigEndian) === 'boolean',
          'missing or invalid endian');
  
      assert.ok(offset !== undefined && offset !== null,
          'missing offset');
  
      assert.ok(offset + 3 < buffer.length,
          'Trying to write beyond buffer length');
  
      verifIEEE754(value, 3.4028234663852886e+38, -3.4028234663852886e+38);
    }
  
    require('./buffer_ieee754').writeIEEE754(buffer, value, offset, isBigEndian,
        23, 4);
  }
  
  Buffer.prototype.writeFloatLE = function(value, offset, noAssert) {
    writeFloat(this, value, offset, false, noAssert);
  };
  
  Buffer.prototype.writeFloatBE = function(value, offset, noAssert) {
    writeFloat(this, value, offset, true, noAssert);
  };
  
  function writeDouble(buffer, value, offset, isBigEndian, noAssert) {
    if (!noAssert) {
      assert.ok(value !== undefined && value !== null,
          'missing value');
  
      assert.ok(typeof (isBigEndian) === 'boolean',
          'missing or invalid endian');
  
      assert.ok(offset !== undefined && offset !== null,
          'missing offset');
  
      assert.ok(offset + 7 < buffer.length,
          'Trying to write beyond buffer length');
  
      verifIEEE754(value, 1.7976931348623157E+308, -1.7976931348623157E+308);
    }
  
    require('./buffer_ieee754').writeIEEE754(buffer, value, offset, isBigEndian,
        52, 8);
  }
  
  Buffer.prototype.writeDoubleLE = function(value, offset, noAssert) {
    writeDouble(this, value, offset, false, noAssert);
  };
  
  Buffer.prototype.writeDoubleBE = function(value, offset, noAssert) {
    writeDouble(this, value, offset, true, noAssert);
  };
  
  SlowBuffer.prototype.readUInt8 = Buffer.prototype.readUInt8;
  SlowBuffer.prototype.readUInt16LE = Buffer.prototype.readUInt16LE;
  SlowBuffer.prototype.readUInt16BE = Buffer.prototype.readUInt16BE;
  SlowBuffer.prototype.readUInt32LE = Buffer.prototype.readUInt32LE;
  SlowBuffer.prototype.readUInt32BE = Buffer.prototype.readUInt32BE;
  SlowBuffer.prototype.readInt8 = Buffer.prototype.readInt8;
  SlowBuffer.prototype.readInt16LE = Buffer.prototype.readInt16LE;
  SlowBuffer.prototype.readInt16BE = Buffer.prototype.readInt16BE;
  SlowBuffer.prototype.readInt32LE = Buffer.prototype.readInt32LE;
  SlowBuffer.prototype.readInt32BE = Buffer.prototype.readInt32BE;
  SlowBuffer.prototype.readFloatLE = Buffer.prototype.readFloatLE;
  SlowBuffer.prototype.readFloatBE = Buffer.prototype.readFloatBE;
  SlowBuffer.prototype.readDoubleLE = Buffer.prototype.readDoubleLE;
  SlowBuffer.prototype.readDoubleBE = Buffer.prototype.readDoubleBE;
  SlowBuffer.prototype.writeUInt8 = Buffer.prototype.writeUInt8;
  SlowBuffer.prototype.writeUInt16LE = Buffer.prototype.writeUInt16LE;
  SlowBuffer.prototype.writeUInt16BE = Buffer.prototype.writeUInt16BE;
  SlowBuffer.prototype.writeUInt32LE = Buffer.prototype.writeUInt32LE;
  SlowBuffer.prototype.writeUInt32BE = Buffer.prototype.writeUInt32BE;
  SlowBuffer.prototype.writeInt8 = Buffer.prototype.writeInt8;
  SlowBuffer.prototype.writeInt16LE = Buffer.prototype.writeInt16LE;
  SlowBuffer.prototype.writeInt16BE = Buffer.prototype.writeInt16BE;
  SlowBuffer.prototype.writeInt32LE = Buffer.prototype.writeInt32LE;
  SlowBuffer.prototype.writeInt32BE = Buffer.prototype.writeInt32BE;
  SlowBuffer.prototype.writeFloatLE = Buffer.prototype.writeFloatLE;
  SlowBuffer.prototype.writeFloatBE = Buffer.prototype.writeFloatBE;
  SlowBuffer.prototype.writeDoubleLE = Buffer.prototype.writeDoubleLE;
  SlowBuffer.prototype.writeDoubleBE = Buffer.prototype.writeDoubleBE;
  
  });
  
  require.define("assert",function(require,module,exports,__dirname,__filename,process,global){// UTILITY
  var util = require('util');
  var Buffer = require("buffer").Buffer;
  var pSlice = Array.prototype.slice;
  
  // 1. The assert module provides functions that throw
  // AssertionError's when particular conditions are not met. The
  // assert module must conform to the following interface.
  
  var assert = module.exports = ok;
  
  // 2. The AssertionError is defined in assert.
  // new assert.AssertionError({ message: message,
  //                             actual: actual,
  //                             expected: expected })
  
  assert.AssertionError = function AssertionError(options) {
    this.name = 'AssertionError';
    this.message = options.message;
    this.actual = options.actual;
    this.expected = options.expected;
    this.operator = options.operator;
    var stackStartFunction = options.stackStartFunction || fail;
  
    if (Error.captureStackTrace) {
      Error.captureStackTrace(this, stackStartFunction);
    }
  };
  util.inherits(assert.AssertionError, Error);
  
  function replacer(key, value) {
    if (value === undefined) {
      return '' + value;
    }
    if (typeof value === 'number' && (isNaN(value) || !isFinite(value))) {
      return value.toString();
    }
    if (typeof value === 'function' || value instanceof RegExp) {
      return value.toString();
    }
    return value;
  }
  
  function truncate(s, n) {
    if (typeof s == 'string') {
      return s.length < n ? s : s.slice(0, n);
    } else {
      return s;
    }
  }
  
  assert.AssertionError.prototype.toString = function() {
    if (this.message) {
      return [this.name + ':', this.message].join(' ');
    } else {
      return [
        this.name + ':',
        truncate(JSON.stringify(this.actual, replacer), 128),
        this.operator,
        truncate(JSON.stringify(this.expected, replacer), 128)
      ].join(' ');
    }
  };
  
  // assert.AssertionError instanceof Error
  
  assert.AssertionError.__proto__ = Error.prototype;
  
  // At present only the three keys mentioned above are used and
  // understood by the spec. Implementations or sub modules can pass
  // other keys to the AssertionError's constructor - they will be
  // ignored.
  
  // 3. All of the following functions must throw an AssertionError
  // when a corresponding condition is not met, with a message that
  // may be undefined if not provided.  All assertion methods provide
  // both the actual and expected values to the assertion error for
  // display purposes.
  
  function fail(actual, expected, message, operator, stackStartFunction) {
    throw new assert.AssertionError({
      message: message,
      actual: actual,
      expected: expected,
      operator: operator,
      stackStartFunction: stackStartFunction
    });
  }
  
  // EXTENSION! allows for well behaved errors defined elsewhere.
  assert.fail = fail;
  
  // 4. Pure assertion tests whether a value is truthy, as determined
  // by !!guard.
  // assert.ok(guard, message_opt);
  // This statement is equivalent to assert.equal(true, guard,
  // message_opt);. To test strictly for the value true, use
  // assert.strictEqual(true, guard, message_opt);.
  
  function ok(value, message) {
    if (!!!value) fail(value, true, message, '==', assert.ok);
  }
  assert.ok = ok;
  
  // 5. The equality assertion tests shallow, coercive equality with
  // ==.
  // assert.equal(actual, expected, message_opt);
  
  assert.equal = function equal(actual, expected, message) {
    if (actual != expected) fail(actual, expected, message, '==', assert.equal);
  };
  
  // 6. The non-equality assertion tests for whether two objects are not equal
  // with != assert.notEqual(actual, expected, message_opt);
  
  assert.notEqual = function notEqual(actual, expected, message) {
    if (actual == expected) {
      fail(actual, expected, message, '!=', assert.notEqual);
    }
  };
  
  // 7. The equivalence assertion tests a deep equality relation.
  // assert.deepEqual(actual, expected, message_opt);
  
  assert.deepEqual = function deepEqual(actual, expected, message) {
    if (!_deepEqual(actual, expected)) {
      fail(actual, expected, message, 'deepEqual', assert.deepEqual);
    }
  };
  
  function _deepEqual(actual, expected) {
    // 7.1. All identical values are equivalent, as determined by ===.
    if (actual === expected) {
      return true;
  
    } else if (Buffer.isBuffer(actual) && Buffer.isBuffer(expected)) {
      if (actual.length != expected.length) return false;
  
      for (var i = 0; i < actual.length; i++) {
        if (actual[i] !== expected[i]) return false;
      }
  
      return true;
  
    // 7.2. If the expected value is a Date object, the actual value is
    // equivalent if it is also a Date object that refers to the same time.
    } else if (actual instanceof Date && expected instanceof Date) {
      return actual.getTime() === expected.getTime();
  
    // 7.3. Other pairs that do not both pass typeof value == 'object',
    // equivalence is determined by ==.
    } else if (typeof actual != 'object' && typeof expected != 'object') {
      return actual == expected;
  
    // 7.4. For all other Object pairs, including Array objects, equivalence is
    // determined by having the same number of owned properties (as verified
    // with Object.prototype.hasOwnProperty.call), the same set of keys
    // (although not necessarily the same order), equivalent values for every
    // corresponding key, and an identical 'prototype' property. Note: this
    // accounts for both named and indexed properties on Arrays.
    } else {
      return objEquiv(actual, expected);
    }
  }
  
  function isUndefinedOrNull(value) {
    return value === null || value === undefined;
  }
  
  function isArguments(object) {
    return Object.prototype.toString.call(object) == '[object Arguments]';
  }
  
  function objEquiv(a, b) {
    if (isUndefinedOrNull(a) || isUndefinedOrNull(b))
      return false;
    // an identical 'prototype' property.
    if (a.prototype !== b.prototype) return false;
    //~~~I've managed to break Object.keys through screwy arguments passing.
    //   Converting to array solves the problem.
    if (isArguments(a)) {
      if (!isArguments(b)) {
        return false;
      }
      a = pSlice.call(a);
      b = pSlice.call(b);
      return _deepEqual(a, b);
    }
    try {
      var ka = Object.keys(a),
          kb = Object.keys(b),
          key, i;
    } catch (e) {//happens when one is a string literal and the other isn't
      return false;
    }
    // having the same number of owned properties (keys incorporates
    // hasOwnProperty)
    if (ka.length != kb.length)
      return false;
    //the same set of keys (although not necessarily the same order),
    ka.sort();
    kb.sort();
    //~~~cheap key test
    for (i = ka.length - 1; i >= 0; i--) {
      if (ka[i] != kb[i])
        return false;
    }
    //equivalent values for every corresponding key, and
    //~~~possibly expensive deep test
    for (i = ka.length - 1; i >= 0; i--) {
      key = ka[i];
      if (!_deepEqual(a[key], b[key])) return false;
    }
    return true;
  }
  
  // 8. The non-equivalence assertion tests for any deep inequality.
  // assert.notDeepEqual(actual, expected, message_opt);
  
  assert.notDeepEqual = function notDeepEqual(actual, expected, message) {
    if (_deepEqual(actual, expected)) {
      fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual);
    }
  };
  
  // 9. The strict equality assertion tests strict equality, as determined by ===.
  // assert.strictEqual(actual, expected, message_opt);
  
  assert.strictEqual = function strictEqual(actual, expected, message) {
    if (actual !== expected) {
      fail(actual, expected, message, '===', assert.strictEqual);
    }
  };
  
  // 10. The strict non-equality assertion tests for strict inequality, as
  // determined by !==.  assert.notStrictEqual(actual, expected, message_opt);
  
  assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
    if (actual === expected) {
      fail(actual, expected, message, '!==', assert.notStrictEqual);
    }
  };
  
  function expectedException(actual, expected) {
    if (!actual || !expected) {
      return false;
    }
  
    if (expected instanceof RegExp) {
      return expected.test(actual);
    } else if (actual instanceof expected) {
      return true;
    } else if (expected.call({}, actual) === true) {
      return true;
    }
  
    return false;
  }
  
  function _throws(shouldThrow, block, expected, message) {
    var actual;
  
    if (typeof expected === 'string') {
      message = expected;
      expected = null;
    }
  
    try {
      block();
    } catch (e) {
      actual = e;
    }
  
    message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +
              (message ? ' ' + message : '.');
  
    if (shouldThrow && !actual) {
      fail('Missing expected exception' + message);
    }
  
    if (!shouldThrow && expectedException(actual, expected)) {
      fail('Got unwanted exception' + message);
    }
  
    if ((shouldThrow && actual && expected &&
        !expectedException(actual, expected)) || (!shouldThrow && actual)) {
      throw actual;
    }
  }
  
  // 11. Expected to throw an error:
  // assert.throws(block, Error_opt, message_opt);
  
  assert.throws = function(block, /*optional*/error, /*optional*/message) {
    _throws.apply(this, [true].concat(pSlice.call(arguments)));
  };
  
  // EXTENSION! This is annoying to write outside this module.
  assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) {
    _throws.apply(this, [false].concat(pSlice.call(arguments)));
  };
  
  assert.ifError = function(err) { if (err) {throw err;}};
  
  });
  
  require.define("/node_modules/buffer-browserify/node_modules/base64-js/package.json",function(require,module,exports,__dirname,__filename,process,global){module.exports = {"main":"lib/b64.js"}
  });
  
  require.define("/node_modules/buffer-browserify/node_modules/base64-js/lib/b64.js",function(require,module,exports,__dirname,__filename,process,global){(function (exports) {
  	'use strict';
  
  	var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
  
  	function b64ToByteArray(b64) {
  		var i, j, l, tmp, placeHolders, arr;
  	
  		if (b64.length % 4 > 0) {
  			throw 'Invalid string. Length must be a multiple of 4';
  		}
  
  		// the number of equal signs (place holders)
  		// if there are two placeholders, than the two characters before it
  		// represent one byte
  		// if there is only one, then the three characters before it represent 2 bytes
  		// this is just a cheap hack to not do indexOf twice
  		placeHolders = b64.indexOf('=');
  		placeHolders = placeHolders > 0 ? b64.length - placeHolders : 0;
  
  		// base64 is 4/3 + up to two characters of the original data
  		arr = [];//new Uint8Array(b64.length * 3 / 4 - placeHolders);
  
  		// if there are placeholders, only get up to the last complete 4 chars
  		l = placeHolders > 0 ? b64.length - 4 : b64.length;
  
  		for (i = 0, j = 0; i < l; i += 4, j += 3) {
  			tmp = (lookup.indexOf(b64[i]) << 18) | (lookup.indexOf(b64[i + 1]) << 12) | (lookup.indexOf(b64[i + 2]) << 6) | lookup.indexOf(b64[i + 3]);
  			arr.push((tmp & 0xFF0000) >> 16);
  			arr.push((tmp & 0xFF00) >> 8);
  			arr.push(tmp & 0xFF);
  		}
  
  		if (placeHolders === 2) {
  			tmp = (lookup.indexOf(b64[i]) << 2) | (lookup.indexOf(b64[i + 1]) >> 4);
  			arr.push(tmp & 0xFF);
  		} else if (placeHolders === 1) {
  			tmp = (lookup.indexOf(b64[i]) << 10) | (lookup.indexOf(b64[i + 1]) << 4) | (lookup.indexOf(b64[i + 2]) >> 2);
  			arr.push((tmp >> 8) & 0xFF);
  			arr.push(tmp & 0xFF);
  		}
  
  		return arr;
  	}
  
  	function uint8ToBase64(uint8) {
  		var i,
  			extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes
  			output = "",
  			temp, length;
  
  		function tripletToBase64 (num) {
  			return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F];
  		};
  
  		// go through the array every three bytes, we'll deal with trailing stuff later
  		for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) {
  			temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]);
  			output += tripletToBase64(temp);
  		}
  
  		// pad the end with zeros, but make sure to not forget the extra bytes
  		switch (extraBytes) {
  			case 1:
  				temp = uint8[uint8.length - 1];
  				output += lookup[temp >> 2];
  				output += lookup[(temp << 4) & 0x3F];
  				output += '==';
  				break;
  			case 2:
  				temp = (uint8[uint8.length - 2] << 8) + (uint8[uint8.length - 1]);
  				output += lookup[temp >> 10];
  				output += lookup[(temp >> 4) & 0x3F];
  				output += lookup[(temp << 2) & 0x3F];
  				output += '=';
  				break;
  		}
  
  		return output;
  	}
  
  	module.exports.toByteArray = b64ToByteArray;
  	module.exports.fromByteArray = uint8ToBase64;
  }());
  
  });
  
  require.define("/node_modules/buffer-browserify/buffer_ieee754.js",function(require,module,exports,__dirname,__filename,process,global){exports.readIEEE754 = function(buffer, offset, isBE, mLen, nBytes) {
    var e, m,
        eLen = nBytes * 8 - mLen - 1,
        eMax = (1 << eLen) - 1,
        eBias = eMax >> 1,
        nBits = -7,
        i = isBE ? 0 : (nBytes - 1),
        d = isBE ? 1 : -1,
        s = buffer[offset + i];
  
    i += d;
  
    e = s & ((1 << (-nBits)) - 1);
    s >>= (-nBits);
    nBits += eLen;
    for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8);
  
    m = e & ((1 << (-nBits)) - 1);
    e >>= (-nBits);
    nBits += mLen;
    for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8);
  
    if (e === 0) {
      e = 1 - eBias;
    } else if (e === eMax) {
      return m ? NaN : ((s ? -1 : 1) * Infinity);
    } else {
      m = m + Math.pow(2, mLen);
      e = e - eBias;
    }
    return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
  };
  
  exports.writeIEEE754 = function(buffer, value, offset, isBE, mLen, nBytes) {
    var e, m, c,
        eLen = nBytes * 8 - mLen - 1,
        eMax = (1 << eLen) - 1,
        eBias = eMax >> 1,
        rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0),
        i = isBE ? (nBytes - 1) : 0,
        d = isBE ? -1 : 1,
        s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0;
  
    value = Math.abs(value);
  
    if (isNaN(value) || value === Infinity) {
      m = isNaN(value) ? 1 : 0;
      e = eMax;
    } else {
      e = Math.floor(Math.log(value) / Math.LN2);
      if (value * (c = Math.pow(2, -e)) < 1) {
        e--;
        c *= 2;
      }
      if (e + eBias >= 1) {
        value += rt / c;
      } else {
        value += rt * Math.pow(2, 1 - eBias);
      }
      if (value * c >= 2) {
        e++;
        c /= 2;
      }
  
      if (e + eBias >= eMax) {
        m = 0;
        e = eMax;
      } else if (e + eBias >= 1) {
        m = (value * c - 1) * Math.pow(2, mLen);
        e = e + eBias;
      } else {
        m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
        e = 0;
      }
    }
  
    for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8);
  
    e = (e << mLen) | m;
    eLen += mLen;
    for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8);
  
    buffer[offset + i - d] |= s * 128;
  };
  
  });
  
  require.define("sys",function(require,module,exports,__dirname,__filename,process,global){module.exports = require('util');
  
  });
  
  require.define("url",function(require,module,exports,__dirname,__filename,process,global){var punycode = { encode : function (s) { return s } };
  
  exports.parse = urlParse;
  exports.resolve = urlResolve;
  exports.resolveObject = urlResolveObject;
  exports.format = urlFormat;
  
  function arrayIndexOf(array, subject) {
      for (var i = 0, j = array.length; i < j; i++) {
          if(array[i] == subject) return i;
      }
      return -1;
  }
  
  var objectKeys = Object.keys || function objectKeys(object) {
      if (object !== Object(object)) throw new TypeError('Invalid object');
      var keys = [];
      for (var key in object) if (object.hasOwnProperty(key)) keys[keys.length] = key;
      return keys;
  }
  
  // Reference: RFC 3986, RFC 1808, RFC 2396
  
  // define these here so at least they only have to be
  // compiled once on the first module load.
  var protocolPattern = /^([a-z0-9.+-]+:)/i,
      portPattern = /:[0-9]+$/,
      // RFC 2396: characters reserved for delimiting URLs.
      delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'],
      // RFC 2396: characters not allowed for various reasons.
      unwise = ['{', '}', '|', '\\', '^', '~', '[', ']', '`'].concat(delims),
      // Allowed by RFCs, but cause of XSS attacks.  Always escape these.
      autoEscape = ['\''],
      // Characters that are never ever allowed in a hostname.
      // Note that any invalid chars are also handled, but these
      // are the ones that are *expected* to be seen, so we fast-path
      // them.
      nonHostChars = ['%', '/', '?', ';', '#']
        .concat(unwise).concat(autoEscape),
      nonAuthChars = ['/', '@', '?', '#'].concat(delims),
      hostnameMaxLen = 255,
      hostnamePartPattern = /^[a-zA-Z0-9][a-z0-9A-Z_-]{0,62}$/,
      hostnamePartStart = /^([a-zA-Z0-9][a-z0-9A-Z_-]{0,62})(.*)$/,
      // protocols that can allow "unsafe" and "unwise" chars.
      unsafeProtocol = {
        'javascript': true,
        'javascript:': true
      },
      // protocols that never have a hostname.
      hostlessProtocol = {
        'javascript': true,
        'javascript:': true
      },
      // protocols that always have a path component.
      pathedProtocol = {
        'http': true,
        'https': true,
        'ftp': true,
        'gopher': true,
        'file': true,
        'http:': true,
        'ftp:': true,
        'gopher:': true,
        'file:': true
      },
      // protocols that always contain a // bit.
      slashedProtocol = {
        'http': true,
        'https': true,
        'ftp': true,
        'gopher': true,
        'file': true,
        'http:': true,
        'https:': true,
        'ftp:': true,
        'gopher:': true,
        'file:': true
      },
      querystring = require('querystring');
  
  function urlParse(url, parseQueryString, slashesDenoteHost) {
    if (url && typeof(url) === 'object' && url.href) return url;
  
    if (typeof url !== 'string') {
      throw new TypeError("Parameter 'url' must be a string, not " + typeof url);
    }
  
    var out = {},
        rest = url;
  
    // cut off any delimiters.
    // This is to support parse stuff like "<http://foo.com>"
    for (var i = 0, l = rest.length; i < l; i++) {
      if (arrayIndexOf(delims, rest.charAt(i)) === -1) break;
    }
    if (i !== 0) rest = rest.substr(i);
  
  
    var proto = protocolPattern.exec(rest);
    if (proto) {
      proto = proto[0];
      var lowerProto = proto.toLowerCase();
      out.protocol = lowerProto;
      rest = rest.substr(proto.length);
    }
  
    // figure out if it's got a host
    // user@server is *always* interpreted as a hostname, and url
    // resolution will treat //foo/bar as host=foo,path=bar because that's
    // how the browser resolves relative URLs.
    if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) {
      var slashes = rest.substr(0, 2) === '//';
      if (slashes && !(proto && hostlessProtocol[proto])) {
        rest = rest.substr(2);
        out.slashes = true;
      }
    }
  
    if (!hostlessProtocol[proto] &&
        (slashes || (proto && !slashedProtocol[proto]))) {
      // there's a hostname.
      // the first instance of /, ?, ;, or # ends the host.
      // don't enforce full RFC correctness, just be unstupid about it.
  
      // If there is an @ in the hostname, then non-host chars *are* allowed
      // to the left of the first @ sign, unless some non-auth character
      // comes *before* the @-sign.
      // URLs are obnoxious.
      var atSign = arrayIndexOf(rest, '@');
      if (atSign !== -1) {
        // there *may be* an auth
        var hasAuth = true;
        for (var i = 0, l = nonAuthChars.length; i < l; i++) {
          var index = arrayIndexOf(rest, nonAuthChars[i]);
          if (index !== -1 && index < atSign) {
            // not a valid auth.  Something like http://foo.com/bar@baz/
            hasAuth = false;
            break;
          }
        }
        if (hasAuth) {
          // pluck off the auth portion.
          out.auth = rest.substr(0, atSign);
          rest = rest.substr(atSign + 1);
        }
      }
  
      var firstNonHost = -1;
      for (var i = 0, l = nonHostChars.length; i < l; i++) {
        var index = arrayIndexOf(rest, nonHostChars[i]);
        if (index !== -1 &&
            (firstNonHost < 0 || index < firstNonHost)) firstNonHost = index;
      }
  
      if (firstNonHost !== -1) {
        out.host = rest.substr(0, firstNonHost);
        rest = rest.substr(firstNonHost);
      } else {
        out.host = rest;
        rest = '';
      }
  
      // pull out port.
      var p = parseHost(out.host);
      var keys = objectKeys(p);
      for (var i = 0, l = keys.length; i < l; i++) {
        var key = keys[i];
        out[key] = p[key];
      }
  
      // we've indicated that there is a hostname,
      // so even if it's empty, it has to be present.
      out.hostname = out.hostname || '';
  
      // validate a little.
      if (out.hostname.length > hostnameMaxLen) {
        out.hostname = '';
      } else {
        var hostparts = out.hostname.split(/\./);
        for (var i = 0, l = hostparts.length; i < l; i++) {
          var part = hostparts[i];
          if (!part) continue;
          if (!part.match(hostnamePartPattern)) {
            var newpart = '';
            for (var j = 0, k = part.length; j < k; j++) {
              if (part.charCodeAt(j) > 127) {
                // we replace non-ASCII char with a temporary placeholder
                // we need this to make sure size of hostname is not
                // broken by replacing non-ASCII by nothing
                newpart += 'x';
              } else {
                newpart += part[j];
              }
            }
            // we test again with ASCII char only
            if (!newpart.match(hostnamePartPattern)) {
              var validParts = hostparts.slice(0, i);
              var notHost = hostparts.slice(i + 1);
              var bit = part.match(hostnamePartStart);
              if (bit) {
                validParts.push(bit[1]);
                notHost.unshift(bit[2]);
              }
              if (notHost.length) {
                rest = '/' + notHost.join('.') + rest;
              }
              out.hostname = validParts.join('.');
              break;
            }
          }
        }
      }
  
      // hostnames are always lower case.
      out.hostname = out.hostname.toLowerCase();
  
      // IDNA Support: Returns a puny coded representation of "domain".
      // It only converts the part of the domain name that
      // has non ASCII characters. I.e. it dosent matter if
      // you call it with a domain that already is in ASCII.
      var domainArray = out.hostname.split('.');
      var newOut = [];
      for (var i = 0; i < domainArray.length; ++i) {
        var s = domainArray[i];
        newOut.push(s.match(/[^A-Za-z0-9_-]/) ?
            'xn--' + punycode.encode(s) : s);
      }
      out.hostname = newOut.join('.');
  
      out.host = (out.hostname || '') +
          ((out.port) ? ':' + out.port : '');
      out.href += out.host;
    }
  
    // now rest is set to the post-host stuff.
    // chop off any delim chars.
    if (!unsafeProtocol[lowerProto]) {
  
      // First, make 100% sure that any "autoEscape" chars get
      // escaped, even if encodeURIComponent doesn't think they
      // need to be.
      for (var i = 0, l = autoEscape.length; i < l; i++) {
        var ae = autoEscape[i];
        var esc = encodeURIComponent(ae);
        if (esc === ae) {
          esc = escape(ae);
        }
        rest = rest.split(ae).join(esc);
      }
  
      // Now make sure that delims never appear in a url.
      var chop = rest.length;
      for (var i = 0, l = delims.length; i < l; i++) {
        var c = arrayIndexOf(rest, delims[i]);
        if (c !== -1) {
          chop = Math.min(c, chop);
        }
      }
      rest = rest.substr(0, chop);
    }
  
  
    // chop off from the tail first.
    var hash = arrayIndexOf(rest, '#');
    if (hash !== -1) {
      // got a fragment string.
      out.hash = rest.substr(hash);
      rest = rest.slice(0, hash);
    }
    var qm = arrayIndexOf(rest, '?');
    if (qm !== -1) {
      out.search = rest.substr(qm);
      out.query = rest.substr(qm + 1);
      if (parseQueryString) {
        out.query = querystring.parse(out.query);
      }
      rest = rest.slice(0, qm);
    } else if (parseQueryString) {
      // no query string, but parseQueryString still requested
      out.search = '';
      out.query = {};
    }
    if (rest) out.pathname = rest;
    if (slashedProtocol[proto] &&
        out.hostname && !out.pathname) {
      out.pathname = '/';
    }
  
    //to support http.request
    if (out.pathname || out.search) {
      out.path = (out.pathname ? out.pathname : '') +
                 (out.search ? out.search : '');
    }
  
    // finally, reconstruct the href based on what has been validated.
    out.href = urlFormat(out);
    return out;
  }
  
  // format a parsed object into a url string
  function urlFormat(obj) {
    // ensure it's an object, and not a string url.
    // If it's an obj, this is a no-op.
    // this way, you can call url_format() on strings
    // to clean up potentially wonky urls.
    if (typeof(obj) === 'string') obj = urlParse(obj);
  
    var auth = obj.auth || '';
    if (auth) {
      auth = auth.split('@').join('%40');
      for (var i = 0, l = nonAuthChars.length; i < l; i++) {
        var nAC = nonAuthChars[i];
        auth = auth.split(nAC).join(encodeURIComponent(nAC));
      }
      auth += '@';
    }
  
    var protocol = obj.protocol || '',
        host = (obj.host !== undefined) ? auth + obj.host :
            obj.hostname !== undefined ? (
                auth + obj.hostname +
                (obj.port ? ':' + obj.port : '')
            ) :
            false,
        pathname = obj.pathname || '',
        query = obj.query &&
                ((typeof obj.query === 'object' &&
                  objectKeys(obj.query).length) ?
                   querystring.stringify(obj.query) :
                   '') || '',
        search = obj.search || (query && ('?' + query)) || '',
        hash = obj.hash || '';
  
    if (protocol && protocol.substr(-1) !== ':') protocol += ':';
  
    // only the slashedProtocols get the //.  Not mailto:, xmpp:, etc.
    // unless they had them to begin with.
    if (obj.slashes ||
        (!protocol || slashedProtocol[protocol]) && host !== false) {
      host = '//' + (host || '');
      if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;
    } else if (!host) {
      host = '';
    }
  
    if (hash && hash.charAt(0) !== '#') hash = '#' + hash;
    if (search && search.charAt(0) !== '?') search = '?' + search;
  
    return protocol + host + pathname + search + hash;
  }
  
  function urlResolve(source, relative) {
    return urlFormat(urlResolveObject(source, relative));
  }
  
  function urlResolveObject(source, relative) {
    if (!source) return relative;
  
    source = urlParse(urlFormat(source), false, true);
    relative = urlParse(urlFormat(relative), false, true);
  
    // hash is always overridden, no matter what.
    source.hash = relative.hash;
  
    if (relative.href === '') {
      source.href = urlFormat(source);
      return source;
    }
  
    // hrefs like //foo/bar always cut to the protocol.
    if (relative.slashes && !relative.protocol) {
      relative.protocol = source.protocol;
      //urlParse appends trailing / to urls like http://www.example.com
      if (slashedProtocol[relative.protocol] &&
          relative.hostname && !relative.pathname) {
        relative.path = relative.pathname = '/';
      }
      relative.href = urlFormat(relative);
      return relative;
    }
  
    if (relative.protocol && relative.protocol !== source.protocol) {
      // if it's a known url protocol, then changing
      // the protocol does weird things
      // first, if it's not file:, then we MUST have a host,
      // and if there was a path
      // to begin with, then we MUST have a path.
      // if it is file:, then the host is dropped,
      // because that's known to be hostless.
      // anything else is assumed to be absolute.
      if (!slashedProtocol[relative.protocol]) {
        relative.href = urlFormat(relative);
        return relative;
      }
      source.protocol = relative.protocol;
      if (!relative.host && !hostlessProtocol[relative.protocol]) {
        var relPath = (relative.pathname || '').split('/');
        while (relPath.length && !(relative.host = relPath.shift()));
        if (!relative.host) relative.host = '';
        if (!relative.hostname) relative.hostname = '';
        if (relPath[0] !== '') relPath.unshift('');
        if (relPath.length < 2) relPath.unshift('');
        relative.pathname = relPath.join('/');
      }
      source.pathname = relative.pathname;
      source.search = relative.search;
      source.query = relative.query;
      source.host = relative.host || '';
      source.auth = relative.auth;
      source.hostname = relative.hostname || relative.host;
      source.port = relative.port;
      //to support http.request
      if (source.pathname !== undefined || source.search !== undefined) {
        source.path = (source.pathname ? source.pathname : '') +
                      (source.search ? source.search : '');
      }
      source.slashes = source.slashes || relative.slashes;
      source.href = urlFormat(source);
      return source;
    }
  
    var isSourceAbs = (source.pathname && source.pathname.charAt(0) === '/'),
        isRelAbs = (
            relative.host !== undefined ||
            relative.pathname && relative.pathname.charAt(0) === '/'
        ),
        mustEndAbs = (isRelAbs || isSourceAbs ||
                      (source.host && relative.pathname)),
        removeAllDots = mustEndAbs,
        srcPath = source.pathname && source.pathname.split('/') || [],
        relPath = relative.pathname && relative.pathname.split('/') || [],
        psychotic = source.protocol &&
            !slashedProtocol[source.protocol];
  
    // if the url is a non-slashed url, then relative
    // links like ../.. should be able
    // to crawl up to the hostname, as well.  This is strange.
    // source.protocol has already been set by now.
    // Later on, put the first path part into the host field.
    if (psychotic) {
  
      delete source.hostname;
      delete source.port;
      if (source.host) {
        if (srcPath[0] === '') srcPath[0] = source.host;
        else srcPath.unshift(source.host);
      }
      delete source.host;
      if (relative.protocol) {
        delete relative.hostname;
        delete relative.port;
        if (relative.host) {
          if (relPath[0] === '') relPath[0] = relative.host;
          else relPath.unshift(relative.host);
        }
        delete relative.host;
      }
      mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');
    }
  
    if (isRelAbs) {
      // it's absolute.
      source.host = (relative.host || relative.host === '') ?
                        relative.host : source.host;
      source.hostname = (relative.hostname || relative.hostname === '') ?
                        relative.hostname : source.hostname;
      source.search = relative.search;
      source.query = relative.query;
      srcPath = relPath;
      // fall through to the dot-handling below.
    } else if (relPath.length) {
      // it's relative
      // throw away the existing file, and take the new path instead.
      if (!srcPath) srcPath = [];
      srcPath.pop();
      srcPath = srcPath.concat(relPath);
      source.search = relative.search;
      source.query = relative.query;
    } else if ('search' in relative) {
      // just pull out the search.
      // like href='?foo'.
      // Put this after the other two cases because it simplifies the booleans
      if (psychotic) {
        source.hostname = source.host = srcPath.shift();
        //occationaly the auth can get stuck only in host
        //this especialy happens in cases like
        //url.resolveObject('mailto:local1@domain1', 'local2@domain2')
        var authInHost = source.host && arrayIndexOf(source.host, '@') > 0 ?
                         source.host.split('@') : false;
        if (authInHost) {
          source.auth = authInHost.shift();
          source.host = source.hostname = authInHost.shift();
        }
      }
      source.search = relative.search;
      source.query = relative.query;
      //to support http.request
      if (source.pathname !== undefined || source.search !== undefined) {
        source.path = (source.pathname ? source.pathname : '') +
                      (source.search ? source.search : '');
      }
      source.href = urlFormat(source);
      return source;
    }
    if (!srcPath.length) {
      // no path at all.  easy.
      // we've already handled the other stuff above.
      delete source.pathname;
      //to support http.request
      if (!source.search) {
        source.path = '/' + source.search;
      } else {
        delete source.path;
      }
      source.href = urlFormat(source);
      return source;
    }
    // if a url ENDs in . or .., then it must get a trailing slash.
    // however, if it ends in anything else non-slashy,
    // then it must NOT get a trailing slash.
    var last = srcPath.slice(-1)[0];
    var hasTrailingSlash = (
        (source.host || relative.host) && (last === '.' || last === '..') ||
        last === '');
  
    // strip single dots, resolve double dots to parent dir
    // if the path tries to go above the root, `up` ends up > 0
    var up = 0;
    for (var i = srcPath.length; i >= 0; i--) {
      last = srcPath[i];
      if (last == '.') {
        srcPath.splice(i, 1);
      } else if (last === '..') {
        srcPath.splice(i, 1);
        up++;
      } else if (up) {
        srcPath.splice(i, 1);
        up--;
      }
    }
  
    // if the path is allowed to go above the root, restore leading ..s
    if (!mustEndAbs && !removeAllDots) {
      for (; up--; up) {
        srcPath.unshift('..');
      }
    }
  
    if (mustEndAbs && srcPath[0] !== '' &&
        (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {
      srcPath.unshift('');
    }
  
    if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {
      srcPath.push('');
    }
  
    var isAbsolute = srcPath[0] === '' ||
        (srcPath[0] && srcPath[0].charAt(0) === '/');
  
    // put the host back
    if (psychotic) {
      source.hostname = source.host = isAbsolute ? '' :
                                      srcPath.length ? srcPath.shift() : '';
      //occationaly the auth can get stuck only in host
      //this especialy happens in cases like
      //url.resolveObject('mailto:local1@domain1', 'local2@domain2')
      var authInHost = source.host && arrayIndexOf(source.host, '@') > 0 ?
                       source.host.split('@') : false;
      if (authInHost) {
        source.auth = authInHost.shift();
        source.host = source.hostname = authInHost.shift();
      }
    }
  
    mustEndAbs = mustEndAbs || (source.host && srcPath.length);
  
    if (mustEndAbs && !isAbsolute) {
      srcPath.unshift('');
    }
  
    source.pathname = srcPath.join('/');
    //to support request.http
    if (source.pathname !== undefined || source.search !== undefined) {
      source.path = (source.pathname ? source.pathname : '') +
                    (source.search ? source.search : '');
    }
    source.auth = relative.auth || source.auth;
    source.slashes = source.slashes || relative.slashes;
    source.href = urlFormat(source);
    return source;
  }
  
  function parseHost(host) {
    var out = {};
    var port = portPattern.exec(host);
    if (port) {
      port = port[0];
      out.port = port.substr(1);
      host = host.substr(0, host.length - port.length);
    }
    if (host) out.hostname = host;
    return out;
  }
  
  });
  
  require.define("querystring",function(require,module,exports,__dirname,__filename,process,global){var isArray = typeof Array.isArray === 'function'
      ? Array.isArray
      : function (xs) {
          return Object.prototype.toString.call(xs) === '[object Array]'
      };
  
  var objectKeys = Object.keys || function objectKeys(object) {
      if (object !== Object(object)) throw new TypeError('Invalid object');
      var keys = [];
      for (var key in object) if (object.hasOwnProperty(key)) keys[keys.length] = key;
      return keys;
  }
  
  
  /*!
   * querystring
   * Copyright(c) 2010 TJ Holowaychuk <tj@vision-media.ca>
   * MIT Licensed
   */
  
  /**
   * Library version.
   */
  
  exports.version = '0.3.1';
  
  /**
   * Object#toString() ref for stringify().
   */
  
  var toString = Object.prototype.toString;
  
  /**
   * Cache non-integer test regexp.
   */
  
  var notint = /[^0-9]/;
  
  /**
   * Parse the given query `str`, returning an object.
   *
   * @param {String} str
   * @return {Object}
   * @api public
   */
  
  exports.parse = function(str){
    if (null == str || '' == str) return {};
  
    function promote(parent, key) {
      if (parent[key].length == 0) return parent[key] = {};
      var t = {};
      for (var i in parent[key]) t[i] = parent[key][i];
      parent[key] = t;
      return t;
    }
  
    return String(str)
      .split('&')
      .reduce(function(ret, pair){
        try{ 
          pair = decodeURIComponent(pair.replace(/\+/g, ' '));
        } catch(e) {
          // ignore
        }
  
        var eql = pair.indexOf('=')
          , brace = lastBraceInKey(pair)
          , key = pair.substr(0, brace || eql)
          , val = pair.substr(brace || eql, pair.length)
          , val = val.substr(val.indexOf('=') + 1, val.length)
          , parent = ret;
  
        // ?foo
        if ('' == key) key = pair, val = '';
  
        // nested
        if (~key.indexOf(']')) {
          var parts = key.split('[')
            , len = parts.length
            , last = len - 1;
  
          function parse(parts, parent, key) {
            var part = parts.shift();
  
            // end
            if (!part) {
              if (isArray(parent[key])) {
                parent[key].push(val);
              } else if ('object' == typeof parent[key]) {
                parent[key] = val;
              } else if ('undefined' == typeof parent[key]) {
                parent[key] = val;
              } else {
                parent[key] = [parent[key], val];
              }
            // array
            } else {
              obj = parent[key] = parent[key] || [];
              if (']' == part) {
                if (isArray(obj)) {
                  if ('' != val) obj.push(val);
                } else if ('object' == typeof obj) {
                  obj[objectKeys(obj).length] = val;
                } else {
                  obj = parent[key] = [parent[key], val];
                }
              // prop
              } else if (~part.indexOf(']')) {
                part = part.substr(0, part.length - 1);
                if(notint.test(part) && isArray(obj)) obj = promote(parent, key);
                parse(parts, obj, part);
              // key
              } else {
                if(notint.test(part) && isArray(obj)) obj = promote(parent, key);
                parse(parts, obj, part);
              }
            }
          }
  
          parse(parts, parent, 'base');
        // optimize
        } else {
          if (notint.test(key) && isArray(parent.base)) {
            var t = {};
            for(var k in parent.base) t[k] = parent.base[k];
            parent.base = t;
          }
          set(parent.base, key, val);
        }
  
        return ret;
      }, {base: {}}).base;
  };
  
  /**
   * Turn the given `obj` into a query string
   *
   * @param {Object} obj
   * @return {String}
   * @api public
   */
  
  var stringify = exports.stringify = function(obj, prefix) {
    if (isArray(obj)) {
      return stringifyArray(obj, prefix);
    } else if ('[object Object]' == toString.call(obj)) {
      return stringifyObject(obj, prefix);
    } else if ('string' == typeof obj) {
      return stringifyString(obj, prefix);
    } else {
      return prefix;
    }
  };
  
  /**
   * Stringify the given `str`.
   *
   * @param {String} str
   * @param {String} prefix
   * @return {String}
   * @api private
   */
  
  function stringifyString(str, prefix) {
    if (!prefix) throw new TypeError('stringify expects an object');
    return prefix + '=' + encodeURIComponent(str);
  }
  
  /**
   * Stringify the given `arr`.
   *
   * @param {Array} arr
   * @param {String} prefix
   * @return {String}
   * @api private
   */
  
  function stringifyArray(arr, prefix) {
    var ret = [];
    if (!prefix) throw new TypeError('stringify expects an object');
    for (var i = 0; i < arr.length; i++) {
      ret.push(stringify(arr[i], prefix + '[]'));
    }
    return ret.join('&');
  }
  
  /**
   * Stringify the given `obj`.
   *
   * @param {Object} obj
   * @param {String} prefix
   * @return {String}
   * @api private
   */
  
  function stringifyObject(obj, prefix) {
    var ret = []
      , keys = objectKeys(obj)
      , key;
    for (var i = 0, len = keys.length; i < len; ++i) {
      key = keys[i];
      ret.push(stringify(obj[key], prefix
        ? prefix + '[' + encodeURIComponent(key) + ']'
        : encodeURIComponent(key)));
    }
    return ret.join('&');
  }
  
  /**
   * Set `obj`'s `key` to `val` respecting
   * the weird and wonderful syntax of a qs,
   * where "foo=bar&foo=baz" becomes an array.
   *
   * @param {Object} obj
   * @param {String} key
   * @param {String} val
   * @api private
   */
  
  function set(obj, key, val) {
    var v = obj[key];
    if (undefined === v) {
      obj[key] = val;
    } else if (isArray(v)) {
      v.push(val);
    } else {
      obj[key] = [v, val];
    }
  }
  
  /**
   * Locate last brace in `str` within the key.
   *
   * @param {String} str
   * @return {Number}
   * @api private
   */
  
  function lastBraceInKey(str) {
    var len = str.length
      , brace
      , c;
    for (var i = 0; i < len; ++i) {
      c = str[i];
      if (']' == c) brace = false;
      if ('[' == c) brace = true;
      if ('=' == c && !brace) return i;
    }
  }
  
  });
  