Clean up some code
Add test for process messages function and refactor it a bit
Merge branch 'master' of github.com:Gwildor/Pyromancer