Register noop Needle Filters.
implemented using basic class constructs....not very happy about this
based off of Filter, removed explicit __init__, intermediate lang field
Register Needle Filters for clang plugin #324

Have the filters show up in the interface.
The current implementation uses an empty filter.

The next step is to write a proper filter for elastic search.

Merge remote-tracking branch 'origin/pr/324' into es
Bring some comments up to date.
Add trigram extractor, and whip it into shape. Sketch PathFilter. Close #325.

From the PR:

In order to do regex queries, we need to extract static substrings from the users' regexes. We then bang those against trigram indices in ES to (hopefully drastically) narrow down the document set we need to examine. Finally, we run the actual regex against those.

Previously, on a "trigrammer" branch, we were extracting actual trigrams from the regex. It turns out we don't need to do that: ES is more than happy to split longer strings into trigrams itself. In addition, that gives us a selectivity boost: the relative positions of the trigrams is something ES can deliver. Thus, we here take the old trigrammer machinery from the "trigrammer" branch and adapt it to return longer strings.

The most interesting work in this PR is the simplified() method of SubstringTree. This takes a tree of boolean nodes (Ands and Ors and, at the leaves, strings) and does some easy simplifications. For example, the regex `yo|hello|there` would emit `Or(['yo', 'hello', 'there'])`, simplified to `Or(['hello', 'there'])` since "yo" is too short to be any use against a trigram index. Ands come into play when there is a wildcard of some kind that we can't (or aren't yet smart enough to) make use of between two other, nonoptional strings: for example, `hello+ there` might become `And(['hello', ' there'])` (or `And(['hello', 'o there'])` if we were really smart.

es_regex_filter and PathFilter, the other attractions, are sketches, not yet intended to be complete, but they are useful as an illustration of why the lower-level stuff is the way it is, so I want them committed together.

I also deleted a lot of dead code. There still remain some parts of the Cox method I half started on; they live because I do intend to go in that direction eventually, probably post-launch, to enable us to extract strings more intelligently.
Add proper, full parsing of bracketed character classes.

This will let us spit out Python and JS regexes so we can run Path- and RegexpFilters.

* Upgrade to parsimonious 0.6 for the `unwrapped_exceptions`.
* Add a min length arg to simplified() so we can use it to make tests more readable and writeable.
Make Unicode char-range bounds work.

Add some shamefully missing docstrings to the visitor.

backslash_hex does not actually match anything outside 0..256, but it's ideologically better to return unicode, so I replaced the chr with unichr there as well. (I'm unable to make re.match(r'\x2014', <anything>) match. If I could, I'd expand the definition of the rule to behave the same.)
Take advantage of parsimonious 0.6's shorter imports.
Rename TrigramTreeVisitor to SubstringTreeVisitor, which is more accurate now that we aren't breaking down substrings into trigrams.
Implement JsRegexVisitor, which translates from DXR-flavored regexes to JS ones.

* Rename BACKSLASH_SPECIAL_CHARS to BACKSLASH_METAS to distinguish them semantically from SubstringTreeVisitor.backslash_specials.
* Break literal_class_char into its own rule so we could visit it separately in the JsRegexVisitor and turn it into text.
* Factor out visit_class_item; it's just a lift_child.
* Tersen visit_class_contents.
Add PythonRegexVisitor, for app-side highlighting.
Maintain backslashes in front of nonliterals like . and $.
Fix FILE-domain search results. They were all crashy and wrong.
Get PathFilter working by hooking it up to the JS regex rewriter. Refs bug 1030313.

You should now be able to fire up test_basic and run path queries.

We introduce a new exception BadQuery, which filters can use to complain about user errors that keep the query from running. In a later commit, we'll catch this and display it instead of 500ing.