Template editor should use Jinja loader's encoding

The template loader wouldn't handle non-ASCII template encodings.
Updated it to use the encoding parameter of the Jinja loader when
reading and writing the template files.

Fixes #46