KT-4347 add indexOf function for Arrays

This is my first attempt at a PR, glad to hear feedback.