Convert app.js code to RequireJS module
Add logic to main.js