Used Mako inheritance in templates

Reduced code repetition significantly in templates.
Merge pull request #78 from dannybutler/master

Used Mako inheritance in templates