Switched to Jinja2 templating system for finer grain control of whitespace in templates