Added states to automaton and a log window to GUI, plus small cleanups.