Moves all middleware into middleware module.

This PR moves all middleware functions that were previously in core/server.js into core/server/middleware.js.  

This was done to improve the readability of core/server.js and to centralize all middleware functionality to one module.

Aside from moving the functions, they were modified to use the express application instance attached to the ghost singleton: ghost.server.