Refactor: Simplified implementation of HELLO command

The old implementation had a lot of duplication of the logic
which would increase the amount of work when fixing bugs.

Change-Id: Ic1864e4020e753faa6f4a24adef7331db157f8b1
Reviewed-on: http://review.couchbase.org/44500
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>