Move app module creation from main.js to app.js

Don't merge ! 

This does not work in `?debug` mode: `main.js` is loaded before `app.js`: the module is used before created
You don't need to pollute the global namespace with `appModule`. You can wrap this in an immediately-called function.