Moved loop-logic into handlebar-template.