unit test for the whole serialization process

Interface Input DataInput anf DataOutput need to be revised, but I left them unchanged
@ChengXiangLi - Yeah that makes sense. But I think we should at least read the class info, field info etc. from the DataInput rather than from the instance pot. That's why we write those info into DataOutput in the first place, right?