Move more connection-related code into connections.{c,h}

More general cleanup / rearrangement - move a bunch of
connection-related code into seperate files for better modularity.

Change-Id: I4d51298a5942afaebbc67a50856813a410044f40
Reviewed-on: http://review.couchbase.org/39017
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>