Implement grep-index, first-index, first-rindex

Names still provisionally awaiting agreement and spec