Reorganized the message and connection classes and added some more Javadocs