Reorganized app.js into multiple files