Allowing compiled templates to TemplateView

If the `template` property is set to a function, assume it is a compiled
template function and accept it. Otherwise, throw an error if it is of
an unacceptable type