Expand variables in templates.
Merge branch 'templatevars'