minor fixes to template function
- make sure it calls itself correctly, now passes same params as it recieves
- vars is reserved, changed for templatevars to avoid confustion
- forcing mustaches again since the removal broke 'listification' as per #9622
- fixes incorrectly successful tests using undefined var, now it is defined
- now returns empty list if items is None to avoid errors
fixes issues with listyfing failing too often
now only flattened ignores failonundefined cause of it's special need
Merge pull request #9626 from bcoca/minor_template_fixes

fixes to template function