Better logging
Fixes
Separated struct definitions into header file
Remove all branches from msghandler
Added udata to handler items
Customisation of msghandler
Added msghandler customisation