Added checksum function for text protocol; more unit tests