NCBC-159: Add debug option to view queries

Change-Id: I99cee6738ca1fb096f2933fed24f3bbc45d04edb
Reviewed-on: http://review.couchbase.org/23788
Reviewed-by: Saakshi Manocha <saakshi.manocha@globallogic.com>
Tested-by: Saakshi Manocha <saakshi.manocha@globallogic.com>