Fix serialization test to test read serialization with uncleared containers.
Refactor serialization test.