Refactor js

Rewriting our js to be more readable and less hacky.


#hidden-inner-form shouldn't exist. Dumb id.