more type checking fixes
funcall tests and fixes
Merge branch 'ql-refactor' of github.com:rethinkdb/rethinkdb into ql-refactor