function polyfillBind (fn, ctx) {
  function boundFn (a) {
    var l = arguments.length;
    return l
      ? l > 1
        ? fn.apply(ctx, arguments)
        : fn.call(ctx, a)
      : fn.call(ctx)
  }

  boundFn._length = fn.length;
  return boundFn
}
Simple bind polyfill for environments that do not support it,
e.g., PhantomJS 1.x. Technically, we don't need this anymore
since native bind is now performant enough in most browsers.
But removing it would mean breaking code that was able to run in
PhantomJS 1.x, so this must be kept for backward compatibility.