basicfuncs: add implementation for $(template)

This function makes it possible to invoke other templates defined
in the configuration, like this:

   $(template foobar)

Assuming "foobar" is defined as a global template, this will invoke that,
and place its result as the result of the $(template) function.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
Merge pull request #196 from balabit/f/add-tf-template

F/add tf template