JCBC-610: Fix decoding of BinaryDocument

Motivation
----------
BinaryTranscoder currently refuses to decode BinaryDocuments because
TranscoderUtils says that a document with BINARY_COMPAT_FLAGS is not in
fact a binary document. This is a bug to be corrected.

Modifications
-------------
Refactored TranscoderUtils to recognize BINARY_COMPAT_FLAGS as binary.
Added a mask to easily extract the common flags part of a 32bit integer
and implemented unit tests to check behavior of both the hasBinaryFlags
method and the BinaryTranscoder.

Result
------
New tests passes and BinaryDocuments can be correctly identified by the
adequate TranscoderUtils method, thus decoded by the BinaryTranscoder.

Change-Id: I54c5ebfdc555f3a0441c21068f3192fdfdf96d9c
Reviewed-on: http://review.couchbase.org/42597
Tested-by: Simon Baslé <simon@couchbase.com>
Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>