fixes type checking for polymorphic functions
Merge branch 'ql-refactor' of github.com:rethinkdb/rethinkdb into ql-refactor
fix object comparisons