Improves document filtering for query and update/remove operations.

This implements record filtering that is closer to match the original MongoDB algorithm. The new code is non-trivial, so I would like more eyes on it.
@rodaine @parkr can you please take a look? Please also feel free to suggest/add any other people who could help with the review.

Note, the the old code is completely replaced by the new implementation and the tests are overhauled, too. Thus, for `lib/filter.js` and `test/testFilterItems.js` it makes sense to look at just the new version rather than at the diff. Thanks!
Ah my bad...let me find the node one.

On Tue, Sep 30, 2014 at 4:12 PM, Vlad Losev <notifications@github.com>
wrote:

> In lib/filter.js:
>
> >
> > +var log = require('../lib/log');
> > +
> > +var logger;
> > +
> > +// Allows comparing ObjectIDs loaded from different modules.
> > +function isObjectId(value) {
> > +  return value && value.constructor && value.constructor.name === 'ObjectID';
>
> Hard to use a Ruby gem in a Node project. Not impossible, if one really
> sets his mind on it, but hard. :-)
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/vladlosev/mongodb-fs/pull/2/files#r18253606>.
>