Move read/write functionality out of record classes. Lots of restructuring.