Add repositories/<id>/branches/ and repositories/<id>/commits resources.

This change adds APIs for getting a list of all branches on a repository, and a
(paginated) list of commits backwards in time from a given starting point. These
are currently implemented for the SVN SCMTool and the GitHub hosting service.

Testing done:
- Ran unit tests.
- Used these in conjunction with my post-commit implementation.

Reviewed at http://reviews.reviewboard.org/r/4265/
Add javascript models for Repository, Branch, and Commit.

This change adds models and collections for repositories, branches, and commits,
along with basic tests for the fetching and parsing logic. This implements the
client side of the new commits and branches resources.

Testing done:
Ran unit tests. Used these models in my larger post-commit changes.

Reviewed at http://reviews.reviewboard.org/r/4266/
Add a generic CollectionView for handling live-updating collections.

This adds a utility view for rendering collections of things. To use this, one
extends this view with a new one that defines the itemViewType attribute. Items
can be added to the collection before or after the view is rendered, and the
results in the DOM will always match the current state of the collection.

Testing done: Ran js-tests, used this in my post-commit view.
Reviewed at http://reviews.reviewboard.org/r/4269/
Fix broken/missing docs and behavior for the new validation API.

The new validation API was missing documentation. While adding it, I
noticed a few problems with how the API was being represented.

The resource name "diffs" collided with the other "diffs" resource, and
overwrote the URI template in the root resource. Resource names should
be unique, and more specific, so I renamed this to "diff_validation." I
also got rid of the mimetype, letting it build upon the new name (and
fixing some oddity with the resource not properly encoding in XML, for
some reason).

I also noticed any client following the link from /validation/ to
/validation/diffs/ would get an error, since there's no GET handler. A
proper REST resource should provide some representation. So, we provide
a payload containing the typical links for getting/posting to the
resource.

I also fixed up some documentation issues, some doc generation
issues with singletons, and added the pages for the validation resource.

Note that this does change the payload key for the diff validation
response.
Move diff expand/collapse support into the new DiffReviewableView.

The resulting code is actually cleaner than the old code, because we
have more context to work from, instead of having to embed a bunch of
stuff inside the links.

There's now unit tests that ensure our expand/collapse logic works
correctly.

It also fixes a regression in collapsing that was introduced in the
original DiffReviewable model that was pulled out early on in the
JavaScript refactoring.

This is the last work needed before we can move the DiffComment
support over.
Provide ReviewRequests and Reviews to reviewables and comment blocks.

Reviewables and CommentBlocks now take 'reviewRequest' and 'review'
attributes, instead of having to call out to gReviewRequest.

The 'reviewRequest' attribute is required, but 'review' is not. If not
provided, AbstractReviewable will get/create a draft Review object from
the ReviewRequest. These two parameters are now required.

Reviewables also now have a convenience function for creating
CommentBlock and adding them. This will do the work of passing along the
ReviewRequest and Review to the CommentBlock instance.

Existing Reviewables and CommentBlocks have been updated to work with
these changes. External ones will need to be changed.