Improve has/any search. Fixes jfinkels/flask-restless#180

This patch improves the `has` and `any` operators as described in jfinkels/flask-restless#180. We have been using it for a while and it works well.