Decouple on click from html

Closes #15