added state_allowed_events method, which when used with a hash event configuration, makes it easy to determine which events are callable given the current state.