Change from static html to MAKO templates

https://gist.github.com/kchomski/5ce80e6a2810be05b6be