Moved template handler to events so it's with its bretheren
Use rewrite for config update rather than direct access. Issue: #487