basicfuncs: Add an $(env) template function

This new template function can be used to look up environment variables
and insert them into the string.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>