Support template mimetypes

Unless I forgot something the only difference between template versions and normal documents is the mimetype.

Fixes #744.
Fixes #746. (still not sure if this is the best API)
Can use ``/-template$/.test(docMimtype)`` as an equivalent to this line. The benefit to that approach is the dev doesn't need to accurately count how many chars are in the second string. Of course, the downside is that it is slightly less efficient...