Serve with Flask. Re-organize, simplify, and turn the Python parts into a proper package. Start rethinking tests. Fixes bug 823320.

Read the individual commits, but here are the highlights:

* Turn CGI into a Flask app, served via WSGI. There are no more .htaccess files necessary (or perhaps even possible).
* Reimagine as a proper Python package. This lets us stop generating Python source code as part of the instance.
* Drastically simplify instances: they no longer contain executables or copies of templates and static resources. All that stuff lives in the dxr Python module, once and for all. This makes development a lot faster, since you don't have to rebuild all the time. 3rd-party templates (which I want to rename "themes" because we have other things called "templates") should still be supported, though I haven't tried it.
* Fix the double-slash-in-URLs bug.