Move read repeated message boilerplate to rt module

It simplifies codegen and reduces generated file size.