Added @index for objects to #each helper.

Currently the `@index` is only returned when looping through an array with the `@each` helper. This PR also returns `@index` when looping through objects as well.