add "distinct" functionality for cursors, tests
less whitespace.. don't ask.
python3 basestring compatability