reword apply-template
implement template-fn*
first cut at template-fn macro