Implement app.installMiddleware

The implementation is mostly a copy of
    loopback-workspace/templates/app.js
Merge pull request #133 from strongloop/feature/app-install-middleware

Implement app.installMiddleware