Refactor js

Rewriting our js to be more readable and less hacky.


Switch to button_to_post