Moved out message processing code into own class.
Merge pull request #52 from murrekatt/main_cleanup

Move out message processing related code to own class