Implement app.middlewareFromConfig

Implement a function registering a middleware using a factory function
and a JSON config.

Example:

    app.middlewareFromConfig(compression, {
      enabled: true,
      phase: 'initial',
      config: {
        threshold: 128
      }
    });
Merge pull request #787 from strongloop/feature/app-middleware-v2

Implement app.middlewareFromConfig