Put templateName on the context instance instead of the context's globals.

Addresses Issue #327