Factored out common code; started working on read_reducer; updated CMakeLists.txt