Fix a couple issues with extension and general resource docs.

ExtensionResource was missing docs, and had old-style fields. Those have
been fixed up so that they have some real doc output.

Also, the @webapi_permission_required decorator wasn't preserving
docs, so that's also fixed.
Preserve decorator state across webapi decorators.

Several of the webapi decorators attempted to set things like possible
error results, but they'd be lost, due to decorators not passing on that
information correctly. In some other cases, the wrong function would be
modified (which ended up working anyway, due to the function's
dictionary being transferred after, but it polluted the function).

There's now a @webapi_decorator, which intelligently merges things like
the error response and request field lists. It's meant as a replacement
for @simple_decorator for creating webapi-specific decorators.

Along with this, the calls to @webapi_response_errors in decorators have
been moved to decorate the correct function.
Set the tracking branch for this branch.
Fix transferring of webapi decorator information.

The recent code to transfer webapi decorator information across
decorators and to intelligently merge them had a couple issues. The
@webapi_permission_required decorator was overwriting data, causing the
errors it sets to go away, and the code to merge checked some state too
late.
Add support for middleware to extensions.

This change adds the ability for extensions to add middleware. This is done by
setting the 'middleware' attribute on the extension's class to be a list of
class names. These are then injected into Django's list of middleware according
to the dependency structure of the extensions.

Testing done: All unit tests pass
Reviewed at https://reviews.reviewboard.org/r/4530/