Clean up negotiation code
Clean up negotiation code

This commit cleans up some of the logic branches and state transitions.
This doesn't actually change behavior, but moves state variables to
booleans and so on.

Change-Id: Ica1aa8c53d239fc9e6995c5039d2b86fd69eb8c5
Reviewed-on: http://review.couchbase.org/74613
Reviewed-by: Sergey Avseyev <87f6d5e4fd3644c3c20800cde7fd3ad1569370b3@gmail.com>
Tested-by: Mark Nunberg <dab05a0fe859c5cb93882b2a75a0d613501b07be@couchbase.com>

avsej/libcouchbase,avsej/libcouchbase,avsej/libcouchbase,avsej/libcouchbase,avsej/libcouchbase,mody/libcouchbase,kojiromike/libcouchbase,couchbase/libcouchbase,kojiromike/libcouchbase,couchbase/libcouchbase,mody/libcouchbase,kojiromike/libcouchbase,mody/libcouchbase,couchbase/libcouchbase,avsej/libcouchbase,couchbase/libcouchbase,mody/libcouchbase,couchbase/libcouchbase,kojiromike/libcouchbase,couchbase/libcouchbase,avsej/libcouchbase,couchbase/libcouchbase