Added $stateChangeError handling for undefined states.

This is my fix for #287, sending a `$stateChangeError` when transitioning to an undefined state. I added tests for this and for failed resolves.