Enable loopback to work with both express 3.x and 4.x

/to @ritch 
/cc @bajtos 

Please note app.installMiddleware() is broken w/ express 4.x. express.router is removed in 4.x and the order of app.use and app.<http-method> in the middleware chain is the same as how the methods are used in the code.