Added C++ implementation of automata class.