Refactor into GCIFReader/Writer