Added unit tests for template engine
Improved template compiler