Revamp build system

Use CMake instead of GNU autotools

Change-Id: I7a187cb6bf732b5858163192c0c8743359a8a3ad
Reviewed-on: http://review.couchbase.org/26096
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>