Added a foreach-index function that iterates over a list with a function with context to its index.