Allowed a wider range of states and events in internal state

#1 Improve state machine generics

This change increase the flexibility of the internal state interface.
Internal states can now accept internal states and actions that do not
exactly match the state and event class type.