lib/router.js
function createBackboneRouterWithPreInitialize() {
	var MonkeyRouter = function(options) {
		if(!_.isUndefined(this.preInitialize)) {
			this.preInitialize(options);
		}

		return Backbone.Router.call(this, options);
	};
	_.extend(MonkeyRouter, Backbone.Router);
	_.extend(MonkeyRouter.prototype, Backbone.Router.prototype);

	return MonkeyRouter;
}
function createBackboneRouterWithPreInitialize() {
	var MonkeyRouter = function(options) {
		if(!_.isUndefined(this.preInitialize)) {
			this.preInitialize(options);
		}

		return Backbone.Router.call(this, options);
	};
	_.extend(MonkeyRouter, Backbone.Router);
	_.extend(MonkeyRouter.prototype, Backbone.Router.prototype);

	return MonkeyRouter;
}
/* createBackboneRouterWithPreInitialize
Creates a backbone router which tries to call a preInitialize method before
calling the actual initialize().

Further Information:
The constructor of the default backbone router looks like the following:

> var Router = Backbone.Router = function(options) {
>   options || (options = {});
>    if (options.routes) this.routes = options.routes;
>   this._bindRoutes();
>   this.initialize.apply(this, arguments);
> };

This means, initialize() is called after the actual routes were bound to
their specific callbacks.
With the introduction of preInitialize() it becomes possible to evaluate
the option object before any route gets bound.
The <Barefoot.Router.Server> makes use of this to inject various variables
which are needed to create the defined routes inside an Express.JS app.

Returns:
A monkey patched version of Backbone.Router with preInitialize capability

See also:
- <Barefoot.Router.Server.preInitialize>