Contemplate.js fixes for nested loops, enable Contemplate.php to be extended by inheritance