Added deriving, a custom compare function for records, added some tests.. still buggy.