Minor improvements to BinaryDecoder/Encoder and added more tests for Socket