Refactor js

Rewriting our js to be more readable and less hacky.


Having a prefix for CSS seems rather unusual compared to the HTML and stylesheets I've seen, especially since most of our classes are for styles. Using a prefix only for JS-specific stuff sounds like a good idea and would still ensure distinct classes/ids.