Refactor DFA.find_distinct
Implement DFA.merge_states
Implement DFA.collect_group