Split app.js, and some other little changes