Exclude diff-associated FileAttachments from the resource list.

FileAttachments associated with a FileDiff shouldn't be shown in the
list of a review request's file attachments. Exclude them from the list.
A future change will add proper API for setting and getting attachments
on a FileDiff.

Also, while here, I added the missing mimetype field.
Fix all the current pyflakes warnings in the codebase.

This fixes all the warnings pyflakes have found so far. Nothing harmful.
It primarily consists of unused imports. However, it did prevent two
unit tests from running, due to duplicate function names.
Move WebAPIResource and utility methods into webapi/base.py.

This introduces a base.py that contains WebAPIResource, and a bunch of
private utility functions from resources.py. Those have moved into
WebAPIResource as utility functions.
Move webapi/tests.py into webapi/tests/.

This is the first change in a series to split up the webapi unit test
suite. It just moves the existing tests into a new webapi/tests/
subdirectory, and updates testdata file paths to work from the new
location.

No logic has changed, and tests can still be executed as before.
However, you may need to delete your webapi/tests.pyc file.
Split the webapi unit tests into per-resource test files.

The webapi unit test suite was getting far too large to maintain. This
splits it out into a bunch of files, one per resource test class. Not
only does that help organization, but it also helps when wanting to run
a specific test suite.

This change does introduce a regression where, due to files importing
classes from other test files, many suites execute more than once. That
will be fixed in a subsequent change that further organizes information
around the tests.
Centralize webapi tests' mimetypes and URL lookups.

The work to split up the webapi test suite had an issue where unit test
classes were being executed multiple times in a test suite run. This
happened because test*.py files were importing classes from other
test*.py files, and nose was finding them. These needed to be imported
in order to get the mimetypes and URLs from those test classes.

This change solves this problem by introducing webapi/tests/mimetypes.py
and webapi/tests/urls.py. mimetypes.py contains the full list of all
expected mimetypes found throughout the test suite. urls.py contains
functions for fetching all the URLs for all resources.

As an aid to urls.py, WebAPIResource now includes functions for
computing the URLs. The ones in urls.py just wrap them to make the
lookups more convenient for the purpose of tests.
Split resources.py into per-resource files.

resources.py has become unmanageable, so it's now split up into a bunch
of different files.

The problem going into this was the interdependency between resources.
At class definition time, they neatly form a tree, but at request
handler time, there are circular dependencies.

The solution to this is to have a Resources class that dynamically loads
the right resources from the right places upon request, and caches
them. All references to resource instances go through this, and it
handles dishing them out. It also handles registering them against
models.

The logic for resources haven't changed. It's just code movement. The
only major change here is the logic in resources/__init__.py.