States, Events, Simulation

Addes states, events and a very basic simulation