Move protobuf-related functions from rt module to rt_pb.