Added theme.py a theme functions helper.

This splits all the theme handling logic to a different file,
so it can be reused.
Fixed the index.html not found exception message.

We should use the actual template_file used, not assume index.html.
Template all of the files in the templates dir, not just index.html.

This is very useful for generating atom feeds, differently named files
and etc.
Added a test for general templates generation.