Fix wrong 'this', localize loop indexes; make test page

Thanks for smalles template engine!

Tested in http://jsfiddle.net/alexbaumgertner/UXZDy/91/