Refactor js

Rewriting our js to be more readable and less hacky.


Should not need '#delete', edit html to fix this.