Make templates HTML-safe by default

Migrated from legacy PR https://github.com/CenterForOpenScience/osf/pull/1231.
Use the `logging` module with a file handler, as described in COSDev: http://cosdev.readthedocs.org/en/latest/osf/migrations.html#migrations