Some OOP-ing of memory handling, notes of ideas for changes, fixed the wrong records being returned by getRecords.