Move common parts of templates to separate files.
Add Makefile.
Update to follow PEP 8.