move template processing functions to separate file

reduce reported max. cyclomatic complexity from 17 to 6.
create regexp dynamically from provided functions
invoke partials replacement from  case
cleanup and add comments
add benchmarks

it's much slower than anything else.
bump to 0.4.5