Use a custom `indexOf` function instead of `Array#indexOf`

Ref. #4.