unified -couchbase and -file cmdline params
reusable Main() for testability
README update with dir:test example
allow caller to quit the Main()
TestMain().
fix http output when error

Before this commit, you'd get half JSON response if you tried a query
like "select * from nonExistentBucket".

The real fix should probably still be all JSON, but this commit should
help for demos.

cbugg: close bug-684
Main() takes a queryChannel instead of chan quit.
TestSyntaxErr() using MockResponse