adds arg checking to JS
Merge branch 'ql-refactor' of github.com:rethinkdb/rethinkdb into ql-refactor