Refactor js

Rewriting our js to be more readable and less hacky.
#TODO remove unused libraries, fix autocomplete, refactor, cleanup rangewizard


oops