Add doc key to template debug statements. Add keys() method to D object. Remove error when can't automatically locate source of errors in jinja templates.