Write unit tests for Message, and make minor code improvements to Message