dxr-build: allow specifying tree build order

Add support for an optional |order| parameter tp tree configs; it should be
an integer, with smaller values being built first.  Trees with unspecified
order will be built after those with specified order, in sorted by tree
name.
Merge support for controlling the order in which trees are built.
Install Flask (and whatever else) from requirements files at provision time.
Move some files around in preparation for turning the Python parts into a legitimate package. (Tests should fail.)

The dxr folder is going to form the core of an installable package. search.py, query.py, and utils.py never change; they just get copied on build. Thus, those can live in the installed package, and the build can just be a config file and .htaccess. To serve, run dxr-serve.py --config=/my/build/dir. We can explain that in the last 2 lines output from dxr-build, much as we currently do with test-server. For WSGI, we can pass in the path to the config file in an env var.

Because this reduces repetition, it makes dev easier: we can just edit the single, installed (with python setup.py develop) version of the server, and git will pick it up—no more having to edit an untracked build artifact. More standard installation and project layout probably won't hurt our community adoption, either.

Note that the package won't encompass the entire project, as there's no nice way to make setup.py build trilite and the clang plugins (that I know of).
Strip out the CGI server, and replace it with a WSGI one.

So far, the WSGI one is just a stub, but it serves and lives in the right place.
Install the dxr module as a development link so it's importable by things like dxr-serve.py.
Make browsing work (on json-test). Serve static files. Learn the build dir from command-line flags. Ditch app singleton. Introduce WSGI file. Improve dxr-serve UI.

Wow. It's amazing how well Flask fits with DXR's design. Static files and a single template dir map exactly, and the "instance" dir represents a build folder. Like fine-toothed gears.

Details:
* Moved template and static folders to the root of the dxr package, where Flask's defaults look for them. Why be weird?
* WSGI file is entirely untested.