Rewrite filter system

Primarily adding support for wild-card filters: "**" matching zero or
more complete path components (only allowed at the beginning of a path
or between path separators,) "*" matching zero or more characters
except the path separator and "?" matching one character except the
path separator.

Also adding support for a third filter type, "ignored," which negates
less specific reviewer or watcher filters and makes it possible to
ignore changes in specific files or sub-trees.  Since the migration
script uses "ALTER TYPE enumtype ADD VALUE value" to perform this
change, which requires PostgreSQL 9.1, I changed the installation
prerequisites check to strictly require PostgreSQL 9.1 or later.  The
migration script doesn't check, but will fail in older PostgreSQL
versions.  This version of PostgreSQL is included in Ubuntu 12.04 and
12.10, as well as in Debian Wheezy, and Debian Squeeze, which has
PostgreSQL 8.4, is already not supported due to a too old Python.

Also revamping the filters UI on /home to display all filters in all
repositories at once, and to display helpful information such as the
number of files matched by a filter, and even list those files.  The
UI for adding a filter is now a dialog with auto-completion for the
path.  The documentation for the filters mechanism is moved from its
rather odd location on /home to a tutorial.  (The documentation on
/home predated the whole tutorial mechanism.  It predated almost the
entire system, in fact.)

Related and significant but under-the-hood change: reduce the 'files'
table to a simple path=>id mapping (where the path is of type TEXT,
i.e. "arbitrarily long string") and drop the directories table
altogether.  This makes a lot of things both simpler and faster.  The
only real problem with this is that PostgreSQL has an internal limit
on the size of "index rows," which means the new 'path' column can't
be indexed directly, and thus also can't be part of a primary key or
a unique constraint.  This is solved by using an index over the MD5
hash of paths for exact-match lookups and uniqueness checking, and a
more complicated GIN index to speed up more complicated path searches.
Add --backup-database/--no-backup-database argument to upgrade.py

Useful for skiping the "do you want to backup the database?" question when
upgrading.
Fix crash when anonymous user reads news item

Also don't mark news as read for other users.
Add "apply-filters" command to cli.py

Used by extension library rather than re-implementing the whole filtering
mechanism.