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
This should not be needed. See https://github.com/elemoine/pyramid_closure/commit/c6871128b37969564d9abd213852762799460b3e.