Message processing

Attempted to give names to nameless messages, swapped section 4 and 5. This needs checking to ensure I didn't break the logic. Very necessary though, as the other was quite hard to understand.
Merge pull request #7 from wmtownsley/patch-7

Message processing