Added core of readRecords functionality, not yet tested.