Fix a bug in indexOf(). Add indexOfElement() and request().

On 2nd inspection, I don't think our external users were vulnerable to this bug because we didn't offer that overload publicly. It was just a performance bug.