[2699] Changed templates to Mako

https://gist.github.com/add00/e4b3e6ca33ac6757f085#file-gistfile1-txt