function bind(f, obj, var_args) {
    var a = slice.call(arguments, 2);
    return function() {
      return f.apply(obj, a.concat(slice.call(arguments)));
    };
  }
Binds a function to an object. The returned function will always use the
passed in {@code obj} as {@code this}.

Example:

  g = bind(f, obj, a, b)
  g(c, d) // will do f.call(obj, a, b, c, d)

@param {Function} f The function to bind the object to
@param {Object} obj The object that should act as this when the function
    is called
@param {*} var_args Rest arguments that will be used as the initial
    arguments when the function is called
@return {Function} A new function that has bound this