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)