Update template.py expression matching to use finditer instead of sub (broken).
Fix regex for ELSE / ENDIF