Support template mimetypes

Unless I forgot something the only difference between template versions and normal documents is the mimetype.
``setTemplate`` sounds more like "set the template for the document". I would suggest ``setIsTemplate`` or perhaps ``setAsTemplate`` to indicate more clearly this is setting the template flag of the current document