Added support for N1QL query parameter substitution.

Borrowed query formatting code from node-mysql.

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