Added checksum calculation, and better testing of message parsing