Refactored app.js. Moved auth to separate files.