Pass current index into handler functions

...in an object so more can be added later without breaking the API