implement non-native indexOf

is a bit faster in some cases