Added method indexOf() and tests for it.