Fix encoding bug caused by commit 54a0160c06fca6ef35eaf9b48875fedf83cb0d85

Add tests exposing bad quoting of types other than text and bytea.
Fix generic quoting code.
Merge pull request #81 from glenebob/backend_text_encoding

Fix encoding bug caused by PR #80