Rewrote binary serialization and deserialization methods to use the build in binary serializer.