Adds generic implementation of find-index.