reverse selector operators when needed (Fixes #402)

Also fixed cases `where ‘abc’ ~ city` to give an “unsupported plan”
error  instead of resulting in errors from Mongo (that is, if you can
slip them past the type checker)
Merge remote-tracking branch 'upstream/master' into ready/402
Merge pull request #415 from mossprescott/ready/402

reverse selector operators when needed (Fixes #402)