Run tag names through escape filter to avoid invalid HTML

If a tag contains characters like <> or &, we currently generate invalid HTML. 
This is easily fixed by sending the tag through the jinja escape filter.

(This bug is not theoretical, I hit it when using C++ template names for tags,
like "boost::variant<>".)