Updating app.js to use define and updating main.js