Improved templatize to do implicit function templating.