Bug fix: redeclaration error if render same template twice.
Add support for template func map.