Improve Mongo compatibility with $ne/$nin/$not and arrays.

Fixes #1451.

We currently handle matches where the key has multiple values due to arrays in
the document in two subtley different ways, depending on whether or not the
array is in the last element of the keypath or not. (This is annoyingly
necessary, at least in the current structure of how we compile selectors, due to
various selectors differing in how they treat arrays.) The negative-style
operators have "must match all values" semantics, but this was only being
enforced when the branching was in the last element of the keypath. This commit
semi-hackily applies those semantics for other branching too.

We are still not 100% Mongo compatible (see XXX comment) but it's closer.