Clean up and simplify code in message.rb, partly based on warnings in RubyMine.
Merge pull request #31 from keithrbennett/cleanup-and-simplify-message-rb

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