Refactoring code to break stuff out of the message parser into separate
methods.  Not only does this clean up the parser, but it makes it easier to
maintain (and extend) those functions later.  Also reformatted some of the
"send message" code so that it's a little easier to read.

Signed-off-by: The Doctor <drwho@virtadpt.net>