templates: Removed usage of tmpl_context and c
config: Added to_envvar() function

This can be used in combination with the ArgumentParser of many command
line scripts to specify the config file.
tracking/server: Use DBSession instead of transaction

We don't have/need multi-database support at the moment...
config: Removed outdated tg2 files
middleware: Removed outdated tg2 files