rtkm: implement serialization.