more detail in History
Fix UI._templateInstance() to look at surrounding template.

Previously we were using the current component to retrieve the template
instance, but what we actually want is the template instance of the
surrounding component that is a template.