Java serialization for ByteString

Java serialization now completely separated from any default
serialization implementation. Also, a test for serialization.