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.