Add templatesFn feature.
Merge pull request #9 from hekike/master

Add templatesFn feature.