Add (de)serialization tests.