Add support for index in each tags

It was requested that the current index could be accessed in the each
tag.