JSCBC-25 Validate input parameters

It turns out that the way node-gyp invoked my compiler the
exception handler didn't work.

Change-Id: I191ae9139383f98fc81663b9603630f341b3c91a
Reviewed-on: http://review.couchbase.org/25875
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>