refactored templating.py for https://github.com/globaleaks/GlobaLeaks/issues/484 and others
fixed unitTest, need to be cleaned, put a TODO
changed defaults for https://github.com/globaleaks/GlobaLeaks/issues/676