Implement and test vector serialization