use a py2/py3 compatibility module - thanks to jinja2 team
more py/py3 compat fixes