Serialization_tester refactored.

Change-Id: I131baacc062f28d9e6e209f0e9d7e719da16b67a