Remove unused import
Write log file as UTF-8
Write Jinja templates as UTF-8. Add beginnings of support for context variables for Jinja templates.