Complete addition of CMsgHandler class

Fixed all errors with the first creation of CMsgHandler - it now works
100% properly; passes unit tests etc.