Updated Renderer, CompositeView and ItemView such that when template() is called, it's in the context of the relevant view, not Window.