Fix more tests (and code)

Biggest fix is that event data was wrong; when binding “this” for an event handler, we didn’t have a pointer to the current template, just a pointer to the prototype (i.e. the object Template.foo itself), and we were using that.