simplify index_of
move implementation details from sequence to is_distinct
move implementation from sequence to index_of
index_of test