General cleanup of the non-promise parts of app.js