Internal IndexOf Implementations

Uses an internal ES5 specish implementation of `indexOf` and `lastIndexOf`
`while` for consistency