Refactor: Use a common class for http-related commands

Change-Id: I6c7a1f654b9c4187e0897824a5010832de243e9a
Reviewed-on: http://review.couchbase.org/23979
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Fix incorrect length cast

Change-Id: I68d716bd152f0dd1a0a6fbdbb9cd0889cae12e9d
Reviewed-on: http://review.couchbase.org/24056
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Merge remote branch 'couchbase/master' into gogiigo