Template engine improved. Multiple if/foreach now supported