Support for event triggered transitions

implements #31 and #56 , similar functionality to aasm