added jinja2 template system and rewrote the static ones

Added the template system, please review.

https://gist.github.com/jchrusciel/ba3d275aafe1ba3906e6