Cache index keys in $indexFor

@jwngr important because we now call $indexFor 2-5 times for each add/update event.