fix parsing of array param in function (was falling in endless loop)
fix use var_export for default params in function (nulls and empty arrays broke templates)
add tests for custom functions in template
Merge branch 'fix-functions-args' into dev