Remove trailing whitespace and unused imports
Split datatypes into structured modules
Couple field and data model together to keep DRY

The DataModel meta class will perform the necessary reflection to
serialize fields correctly.
Rewrite socket reading and data parsing logic
Don't discard the remaining buffer after reading message

This causes bugs where if the buffer contains the start of the next
message, the remaining message data will be garbled as the header is
missing.
Use BytesIO for bytes, not StringIO