Change how dfa_concat works

Now instead of concatenating each DFA with the one previous, it
concatenates each dfa with the concatenation of every previous
DFA.

Also fixed a bug where elements were being removed from a list
mid iteration which caused the loop to terminate prematurely.

Identified a bug in merge_states where cases in which 'r' is
accepting but 's' is not are not handled correctly.