Move message processing to new 'procmsg' module.

Compiles and passes tests.  Could use some refinement.
Suggestion: remove the unneeded newlines here.