Serialize, wraps toVector, with tests.