Fix bug in which we tried to mkdir in the source folder (atop existing dirs) instead of the target folder.
Implement request-time folder views. We can browse again!

* Attach an ElasticSearch pool to the app. I'm not positive this is the best place, but it seems to be instantiated only once under dxr-serve.
* Start using url_for() in several places so we don't have to repeat the knowledge stored in route definitions. It even shortens things!
* Refactor folder.html so it takes a single stream of combined files and folders. Saves some repetition.
* Stop showing mod dates and sizes for folders. They're useless and just noise, respectively.
* Along with the previous info, also index files' names (for sorting) and containing folder paths (for folder view queries).
* Stop indexing file entries for binary files until we have a way to display them.
* Start indexing folders into the 'files' doctype (weirdly enough) so we can build directory listings and find path matches in folder paths, even for empty folders.
* Fix a few things with our Flask app setup to let url_for() work for static files and non-default wwwroots.
* Move folder.png to mimetypes folder so we can treat them pretty much like file icons, simplifying implementation.
* Start indexing file paths so we can sort search results by them.
* Store the tree OrderedDict in the generated config file in alphabetical order. This saves sorting when generating the tree menu for request-time pages (and otherwise, too).
Delete now-unused index-time build_folder() and some unused imports.
don't crash if no warnings present...
Don't crash annotations if no warnings present... Merges #312
register missing needles for integration testing
[bug 1030311] Port query machinery to ES. Add a basic TextFilter to prove it works.

You can now run dxr-serve and do find-as-you-type string queries. Direct search is yet to come.

* Remove SQL profiling support from query machinery. Add support for path highlighting.
* Add TextFilter. Works for basic text searches. Still needs case sensitivity and negation.
* Delete a lot of dead code from extents module.
* Change highlight() (neé highlight_line()) to operate on unicode (which everything is now) and take overlapping and unordered extents (which happens when they're drawn from disparate plugins).
* Change the 'type' key of query terms to 'name' for consistency with the 'name' attr of Filter.
* Add description attr to Filter contract.
* Add field arg to Filter.highlight() to save redundant computation and make query module code shorter.
* Add abstract Filter class.
switch to get
removed additional groupby
Add a little documentation, and change a variable name to something that doesn't look like a zero.
Port query machinery to ES.
Removed additional groupby. Closes #317

After discussion with Erik, I couldn't rationalize why the additional group_by was necessary.
The tl;dr is we no longer need it....so I removed it

Merge remote-tracking branch 'origin/pr/317' into HEAD
wrote scaffolding for filters
added language parameter
reimplemented needles with line span information built in
Removed parens and raise UnOrderedRowError
rough shape of filter
switched to dictionary representation
sorted output and wrap in contents
typos!