Add a way to set global template variables. Needs cleanup.