Add the automata package.
Improve automata tests.