Add six.string_types for python3 compatible string checking

Add the six library for python2/3 compadability. Rather then checking
str and unicode directly use string_types.
Remove .encode from quotes

.encode returns an encoded byte string in python3. When a bytearray
is passed to psycopg2's adapt() it casts it to a bytearray which isnt
handled properly by to_tsquery.

http://www.postgresql.org/docs/9.3/static/textsearch-controls.html