Allows ACLs/settings in model config
Merge pull request #745 from strongloop/feature/allow-acls-settings-config

Allows ACLs/settings in model config
Middleware phases - initial implementation

Modify the app and router implementation, so that the middleware is
executed in order defined by phases.

Predefined phases:

    'initial', 'session', 'auth', 'parse', 'routes', 'files', 'final'

Methods defined via `app.use`, `app.route` and friends are executed
as the first thing in 'routes' phase.

API usage:

    app.middleware('initial', compression());
    app.middleware('initial:before', serveFavicon());
    app.middleware('files:after', loopback.urlNotFound());
    app.middleware('final:after', errorHandler());

Middleware flavours:

    // regular handler
    function handler(req, res, next) {
      // do stuff
      next();
    }

    // error handler
    function errorHandler(err, req, res, next) {
      // handle error and/or call next
      next(err);
    }
Merge pull request #767 from strongloop/feature/app-middleware

Middleware phases - initial implementation
Merge remote-tracking branch 'upstream/master'
Revert "Merge remote-tracking branch 'upstream/master'"

This reverts commit 166cef2b28b4b39182e5a845c961ca2ea69dd808, reversing
changes made to 580a3a1c35397c21a331cfccdac6c1ddeba2d823.