Added support for N1QL query parameter substitution.

Borrowed query formatting code from node-mysql.

Change-Id: Ib0fb2803c2b7c1a0e60cd4b63f0be61e61bd05bd
Updated to new libcouchbase.

Change-Id: I0fbf92c1a80b902e50c8a37b304abe06c0ff8856

Woops...

Change-Id: Id8c778d10df373357ee4685752cce8ea1d97f84b