Fix #2 - Improve getTemplateName

Improve getTemplateName to handle:
1. smarter paths - uses relative
2. root with inner directories
3. handle extension name better