Support variable-specific substitutions in templates.

Change-Id: I6af84f48eaa4ee44c8d8babddd8d10a1e1095101
Merge "Support variable-specific substitutions in templates."