VX(Li): Add the serialization methods and their unit tests.