A rewrite of render_mako class from web.contrib.template (Web.py)