Bug fixes and documentation

Started documenting methods and as a result started fixing bugs in core
functions. Fixed bug in in getRecords and selectRecords, that prevented
records from being retrieved. Started fixing bug in getUnique.