Extracted repeated code into a function
Moved some checks around
Changed the way statusmessage is allocated
Introduced data pointer and data_length
Returned the length check
Merge pull request #413 from nurupo/master

Cleanup of Messenger.c