The compile step was previously matching the templates with a regex, iterating through the matches and doing a search and replace for each match. YUCK!