config: move template rendering functions to template.py

Moved Cheetah and Genshi rendering functions to their own file and added a
'name' rendering type which defaults to Cheetah for now.
template: add support for the Mako template engine
config: render filenames using a custom rendering function

This removes a hard dependency on Cheetah, but maintains it as a default
rendering engine when no other engine has been selected.

The custom name rendering function does basic variable expansion similar to
a simple Cheetah template.