code: function callWithContext(functionToCall, arg, cancelCallbackOrContext, context) {
  	if (cancelCallbackOrContext) {
  		if (context) {
  			functionToCall.bind(context)(arg);
  		} else {
  			functionToCall.bind(cancelCallbackOrContext)(arg);
  		}
  	} else {
  		functionToCall(arg);
  	}
  }
docs: Call a function with a single argument (arg), and bind the correct context. If no cancelCallback is defined, use cancelCallbackOrContext as context, otherwise use context.
  @param {*} functionToCall The function that should be called - must take one argument.
  @param {*} arg The argument to pass to functionToCall
  @param {*} cancelCallbackOrContext A callback, or context if no callback is provided.
  @param {*} context A context to bind to the funcitonToCall.