Refactor indexOf and lastIndexOf

Re-use `findIndex` and `findLastIndex` to implement `indexOf` and `lastIndexOf`