Huge refactor of JS, again, plus made the page load through AJAX posts to cut out some more code