Added a $stateNotFound event which can prevent or redirect state transitions.
Added lazy-state definition test.