Templating: Added support for if command and support for length for arrays and strings