Implement Automata

This is a big commit, but implements an implementaion of Automata.
Although this system is slightly inconvinient the way its
implemented now. It is intended to be used as a backend system
for something else. Like a JSON strukture for Automata.