Move widget html (js) to template

- So it is only defined in one place
- So you can easily override it