Jinja renderer, timezone module/state fixes (2014.1 branch)

This is #12724, backported to the 2014.1 branch. Only merge this if #12724 is complete and doesn't break tests.