Added state transitions

State transitions are now recorded in state treees by parsing the body of event functions.