JSCBC-126: Added common flags support.

Change-Id: Ia54db6bfefe5cd984c6e4ca8b5f180bce5c63e5c
Reviewed-on: http://review.couchbase.org/41191
Reviewed-by: Mark Nunberg <mnunberg@haskalah.org>
Tested-by: Brett Lawson <brett19@gmail.com>