Allow mock commands to operate from multiple protocols

This patchset cleans up the mock code, and also adds an HTTP listener
for mock commands. This makes it easy to control the mock using a web
browser.

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