Added jinja2 macros

Replacing javascript appends.