adds argument checking to JS connection and cursor API's
adds unit tests
Merge branch 'v1.4.x' of github.com:rethinkdb/rethinkdb into v1.4.x