Some reorganization, leaving SQL as a compatibility layer
Improve connection state handling; send Sync as necessary
Refactor protocol into separate frontend/backend messages

Also switch to more efficient and flexible Data.ByteString.Builder