CRM-12930 Execute Smarty templates before token replacement

See http://issues.civicrm.org/jira/browse/CRM-12930