Added a Simulator for graphs. It includes a major refactoring.