Major cleanup of the app.js.