Fix #896 -- support hooks in templates.

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>