Refactors app.js into multiple files