(function (ko, _, undefined) {

  /* _ methods that take the list as the first arg (and their aliases) */
  var methods = [
    // Collections
    "each", "forEach",
    "map", "collect",
    "reduce", "inject", "foldl",
    "reduceRight", "foldr",
    "find", "detect",
    "filter", "select", "filter_", "select_",
    "where",
    "reject", "reject_",
    "all", "every",
    "any", "some",
    "include", "contains",
    "invoke", "invoke_",
    "pluck",
    "max",
    "min",
    "sortBy", "sortBy_",
    "groupBy", "groupBy_",
    "countBy", 
    "sortedIndex",
    "shuffle", "shuffle_",
    "size",

    // Arrays
    "first", "head","take",
    "initial",
    "last",
    "rest", "tail", "rest_", "tail_","drop","drop_",
    "compact", "compact_",
    "flatten", "flatten_",
    "without", "without_",
    "union","union_",
    "intersection",
    "difference",
    "uniq", "unique", "uniq_", "unique_",
    "zip","zip_",
    "object",
    "indexOf",
    "lastIndexOf",
    "sortedIndex",
    "range",

    // Misc
    "chain"
  ],
  arrayMethods = [
    "union", "union_",
    "intersection", "intersection_",
    "difference", "difference_",
    "zip", "zip_"
  ];

  _.each(_.union(methods, arrayMethods), function (fn) {
    // Let's be good and safe Javascript citizens!
    if (!ko.observableArray.fn[fn]) {
      ko.observableArray.fn[fn] = function () {
        var args = _.toArray(arguments);

        // Auto-invoke KO arrays
        if (_.include(arrayMethods, fn)) {
            _.each(args, function (arg, i) {
                // Check if it contains a fn we know we attach
                // to KO arrays, just in case someone passes in
                // something other than a KO array fn
                if (typeof arg === "function" && arg[fn]) {                    
                    args[i] = arg();
                }
            });
        }

        // Prepend the raw array value
        args.splice(0, 0, this());

        // Mutator method?
        if (fn.substr(fn.length - 1, 1) === "_") {
            // Mutate the value (leverage KO to handle change notifications)
            return this(_[fn.substr(0, fn.length - 1)].apply(this, args));
        } else {
            // Call original _ method        
            return _[fn].apply(this, args);
        }
      };
    }
  });

})(ko, _);
@@ -1,8 +1,218 @@
+(function (factory) %7B%0A  if (typeof define === 'function' && define%5B'amd'%5D) %7B%0A    // AMD Anonymous module%0A    define(%5B'knockout', 'underscore'%5D, factory);%0A  %7D else %7B%0A    factory(window%5B'ko'%5D, window%5B'_'%5D);%0A  %7D%0A%7D
 (functio
@@ -2530,12 +2530,8 @@
 %0A%0A%7D)
-(ko, _
+%0A
 );
+%0A

Support AMD loading