Isolate HTTP bootstrapping code

Change-Id: Ibba093ec65d35b86295292447ea7f931c2258e52
Reviewed-on: http://review.couchbase.org/30797
Reviewed-by: Mark Nunberg <mnunberg@haskalah.org>
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>