Add tests for BadMsgNotificationHandler.

For the new test NSubstitute package is used.
Update BadMsgNotificationHandler (refactoring).

Updated debug message and added throwing of NotImplementedException on
every unhandled error code.