text_reader: move the class into the cpp file