Clean up and simplify code in message.rb, partly based on RubyMine warnings.

message.rb is one of the most critical files in this gem.   This commit attempts to make it cleaner and more consistent, to eliminate distractions, improve readability, and to provide a base point for future enhancements/improvements.