Moved event building out of script.js, reload/close events work again, fixed a bug with settings where the setting type got eaten by _.extend, moved all javascript to js/