[1865] Changing Jinja2 templates to mako

https://gist.github.com/jakubjanuzik/1b7d9bdc17e4aefcc61f