[ticket/289] Add method for assigning template vars

Fixes #289