Updated bytes decoding in BaseAdapter.represent(), updated sql test to be 'basestring' py3 compatible