Refactor LocalCollection._makeLookupFunction

Based on a lot of experimentation about how Mongo handles arrays,
numeric indices, and nulls.

Also sets the groundwork for update modifiers with "foo.$.bar" by
tracking arrayIndex during lookups.

Adds a few expected_fail tests for where I found behavior that differed
from Mongo.

Some of this behavior seems to have changed between (stable) Mongo 2.4
and (unstable) Mongo 2.5.  In the interest of future-proofing, I have
preferred the 2.5 behavior.
Fix an old comment.
Factor sort code into its own file.
Some updates to our NOTES file.
refactor: _compileSelector results {result:bool}

instead of just a bool.  This will give us room to add arrayIndex (and
perhaps to get the geoquery distance stuff into a better place).

This is just a very surface refactoring: it doesn't even extend to the
"value selectors" yet.
Minor refactoring in compileDocumentSelector
Implement $comment

It's a top-level logical operator that is ignored.
Support "obj" name in $where
refactor: logical operators use structured return
Drop unused arg from logical operator compilation
Refactor logical ops; better error for non-object
Add expect_fail test for an XXX comment
compileValueSelector: remove unused argument
Refactor compileValueSelector

Pull out equality and regexp. Nothing else changes.
Refactor equality to use new lookup function
Major simplification to equality code
Two expect_fails now pass
Fix incorrect expect_fail tests

On further verification against MongoDB (and common sense), these young
expect_fail tests were actually correctly failing.
Implement $lt in the new model

Fix an invalid test

Don't run some $not/$lt tests, because $not is broken for now
Refactor regexp match to use new style

Also implement regexp-vs-regexp matching, for completeness sake