Remove unused files and features from the JavaScript assets

Also refactored all models into the models/ folder and moved the window.onerror handler to base.haml (in order to avoid "Script Error" where we want real errors)