Add tests for de/serializing