Add jshint pretest, prevent stdout pollution

Add jshint as "pretest" script, fix the issues discovered.

Prevent `couchapp messages from polluting stdout by temporarily redirecting console.log to the debug log.

/to @rmg please review.

Once this patch has landed, I think the module is ready for the first release.