var __loader = (function() {

var loader = {};

loader.packages = {};

loader.packagesLinenoOrder = [{ filename: 'loader.js', lineno: 0 }];

loader.extpaths = ['?', '?.js', '?.json', '?/index.js'];

loader.require = function(path) {
  var module;
  var extpaths = loader.extpaths;
  for (var i = 0, ii = extpaths.length; !module && i < ii; ++i) {
    var filepath = extpaths[i].replace('?', path);
    module = loader.packages[filepath];
  }

  if (!module) {
    throw new Error("Cannot find module'" + path + "'");
  }

  if (module.exports) {
    return module.exports;
  }

  module.exports = {};
  module.loader(module, loader.require);
  module.loaded = true;

  return module.exports;
};

loader.define = function(path, lineno, loader) {
  var module = {
    filename: path,
    lineno: lineno,
    loader: loader,
  };

  loader.packages[path] = module;
  loader.packagesLinenoOrder.push(module);
  loader.packagesLinenoOrder.sort(function(a, b) {
    return a.lineno - b.lineno;
  });
};

loader.getPackageByLineno = function(lineno) {
  var packages = loader.packagesLinenoOrder;
  var module;
  for (var i = 0, ii = packages.length; i < ii; ++i) {
    var next = packages[i];
    if (next.lineno > lineno) {
      break;
    }
    module = next;
  }
  return module;
};

return loader;

})();

@@ -203,203 +203,75 @@
 der.
-require = function(path) %7B%0A  var module;%0A  var extpaths = loader.extpaths;%0A  for (var i = 0, ii = extpaths.length; !module && i %3C ii; ++i) %7B%0A    var filepath = extpaths%5Bi%5D.replace('?', path);%0A   
+paths = %5B'lib', 'vendor'%5D;%0A%0Aloader.require = function(path) %7B%0A  var
  mod
@@ -287,32 +287,25 @@
 der.
-p
+getP
 ackage
-s%5Bfilepath%5D;%0A  %7D%0A
+(path);
 %0A  i
@@ -550,24 +550,93 @@
 xports;%0A%7D;%0A%0A
+var compareLineno = function(a, b) %7B return a.lineno - b.lineno; %7D;%0A%0A
 loader.defin
@@ -666,18 +666,19 @@
 no, load
-er
+fun
 ) %7B%0A  va
@@ -746,18 +746,19 @@
 er: load
-er
+fun
 ,%0A  %7D;%0A%0A
@@ -872,61 +872,582 @@
 ort(
-function(a, b) %7B%0A    return a.lineno - b.lineno;%0A  %7D)
+compareLineno);%0A%7D;%0A%0Aloader.getPackage = function(path) %7B%0A  var module = loader.getPackageAtPath(path);%0A  var paths = loader.paths;%0A  for (var i = 0, ii = paths.length; !module && i %3C ii; ++i) %7B%0A    var dirpath = paths%5Bi%5D;%0A    module = loader.getPackageAtPath(dirpath + '/' + path);%0A  %7D%0A  return module;%0A%7D;%0A%0Aloader.getPackageAtPath = function(path) %7B%0A  var module;%0A  var extpaths = loader.extpaths;%0A  for (var i = 0, ii = extpaths.length; !module && i %3C ii; ++i) %7B%0A    var filepath = extpaths%5Bi%5D.replace('?', path);%0A    module = loader.packages%5Bfilepath%5D;%0A  %7D%0A  return module
 ;%0A%7D;

Add loader.js paths for attempting to load relative to multiple paths