Templates: Fixed bug affecting if nested inside for.
Updated Templates documentation.
Templates: Removed Empty.
Templates:  Simplified template type to a newtype.
Shared:  Added metaToJSON.

This will be used in writers to create a JSON object for use
in the templates from the pandoc Meta object and a list of
variables.