Unit tests: add serialization tests