docs: function tryWith(loaderFunction, ARConstructor, ARID, userFunction, options){
  	if(!options){
  		options = {}; // Because referring to undefined's properties (as could be the case below) is an error in JS.
  	}
  	
  	// Process the provided options.
  	// Delay function, used to delegate execution to the event loop some time in the future.
  	var delegationFunction = (options.delegationFunction) ? options.delegationFunction : setImmediate;
  	function delay(continuation) {
  		return when.promise(function(resolve){
  			delegationFunction(resolve);
  		}).then(continuation);
  	}
  	// Allow the caller to specify a failure logger function, to which all intermediate errors will be passed.
  	var failureLogger = (options.failureLogger) ? options.failureLogger : function(){};
  
  	// By default, an infinite retry strategy is employed.
  	var retryStrategy = (typeof(options.retryStrategy) === 'function') ? options.retryStrategy : RetryStrategy.CounterStrategyFactory(Infinity);
  	var shouldTryAgain = function shouldTryAgain(error){
  		var strategyError = retryStrategy(error);
  		// The strategy should tell us whether it thinks retrying is reasonable:
  		var strategyRetryDecision = (!strategyError);
  		// However, we do not have to agree with it - all critical errors, no matter what the strategy has decided, should fail the tryWith procedure.
  		var ownDecision = (error && error.labels && error.labels.isRetriable);
  		
  		return strategyRetryDecision && ownDecision;
  	};
  	
  	function singlePass() {
  		// Delegate the loading itself to the dependency-injected loader function (hopefully, it's something useful, such as a bound Event Store method).
  		return when.try(loaderFunction, ARConstructor, ARID).then(function runUserFunction(aggregateInstance) {
  			return when.try(userFunction, aggregateInstance).then(function saveAggregateState(userFunctionResult) {
  				return when.try(aggregateInstance.commit.bind(aggregateInstance), options.commitMetadata || {}).catch(function handleSavingError(savingError) {
  					failureLogger(savingError);
  					var strategyAllowsAnotherTry = shouldTryAgain(savingError);
  					if (strategyAllowsAnotherTry) {
  						return delay(singlePass);
  					}
  					else {
  						return when.reject(savingError);
  					}
  				}).yield(userFunctionResult);
  			});
  		}, function handleLoadingError(loadingError) {
  			failureLogger(loadingError);
  			var strategyAllowsAnotherTry = shouldTryAgain(loadingError);
  			if (strategyAllowsAnotherTry) {
  				return delay(singlePass);
  			}
  			else {
  				return when.reject(loadingError);
  			}
  		});
  	}
  	
  	return singlePass();
  }