Massive cleanup, reorganization, fixes and commenting.
Fix binary and string quoting
Fix number of arguments to reset_pk_sequence!
Hook everything up for proper binary support.

Including escape on SQL input, unescape on output and
send as binary via parameter. Layer currently buggy.
Return id from insert APIs