[Issue #514] Added tests to prove the problem.  Added a JSONMatcher to make it much easier to compare expected queries with actual ones.
[Issue #514] Fixed #514, correcting the way the "$not" keyword is applied for different types of operators.