Fix multi-select closing in the dashboard for Local Sites.

The multi-select closing in the dashboard wasn't providing any local
site information, and wasn't using the display ID for review requests.
We now pass the proper information to the template and JavaScript in
order to handle this case.

Reviewed at https://reviews.reviewboard.org/r/6588/
Fixes bug #3561
Centralize serialization/deserialization of resource models.

Previously, all JavaScript resource models were responsible for
implementing toJSON() and parseResourceData() functions. In many cases,
there were inconsistencies in how they handled certain
serialization/deserialization operations.

Along with this, we had no way of mapping attribute names to JSON
fields. This meant that, in some cases, calling code had to know about
the JSON fields in order to perform certain operations (like
fine-grained saving of fields).

Now, resources list the attributes to serialize and deserialize, and can
provide a map between attribute names and JSON field names. They can
also list custom serializers/deserializers for different fields. All
common serializers are provided in a new RB.JSONSerializers object.

This doesn't fully remove the need for toJSON or parseResourceData
functions, but most are gone. Most others can be removed down the road
if we centralize text type processing into a mixin.

An upcoming change will allow fine-grained saving of fields based on
attribute names, allowing us to make faster API calls with less impact
on the server.

Reviewed at https://reviews.reviewboard.org/r/6587/
Allow for saving specific attributes on resource models.

Backbone's save() method accepts an 'attrs' option that contains a
dictionary of attribute names and new values. That's nice and all, but
there are times when you already have data set and want to just specify
which attributes to save.

Our version of save() now allows attrs to be an array of attribute
names. Those attributes will be fetched from the payload and saved,
without any of the other attributes on the model.

Care needs to be taken to only use this option when you know that the
save operation will only require those attributes. Creation of certain
resources may require additional attributes, as may an extension's
extra_data in certain cases. Rather than using this in every save()
call, we should only it where we know it'll make sense.

Some call sites have been updated to use this for simple cases and for
resources working with multiple rich text fields, in order to prevent
stomping over those fields' values server-side.

Reviewed at https://reviews.reviewboard.org/r/6590/
Fix loading review public states and resolving comment issues.

We were deserializing the 'public' state of reviews and replies
incorrectly, which led to problems when operating on any child
resources. One affected set of resources were the comment resources,
which became clearly broken when trying to resolve issues.

Once fixed, I noticed that, like the review dialog, closing an issue
would take the HTML-formatted text originally fetched and send that in
the request. We only need to send issueStatus, and don't want to
override the comment, so we now set an appropriate attrs option.

Reviewed at https://reviews.reviewboard.org/r/6601/
Add a blank models.py to reviewboard/webapi/.

This will help with import errors when switching back-and-forth between
release-2.0.x and master.
Fix replying to comments.

When updating the code to be selective about the attributes being
passed, we stopped passing the replyToID. This attribute is pretty
important, and failing to pass it results in being unable to respond to
reviews. This change adds it to the list.
Don't attempt a doomed request when publishing review replies.

When publishing review replies, we'd attempt to reset the state. Part
of this operation was discarding the reply if empty. However, in the
case of publishing, we've just set up a new reply and know we don't have
a reply sitting around to reset.

We now simply skip this step if publishing.

This also fixes the banner persisting on the screen if discarding twice
in a row.

Reviewed at https://reviews.reviewboard.org/r/6603/
Add support for Kiln and FogBugz as hosting services.

Kiln and FogBugz are services provided by Fog Creek for repository
hosting and bug tracking, respectively. Kiln does not support any
built-in endpoints for Mercurial file fetching, and the Git hosting is
not compatible with the raw file URL support.

This change adds support for working with repositories stored on Kiln,
and for easily setting up bug tracking at FogBugz.

The Kiln API has almost everything needed for fetching commits for the
New Review Request page, but is just useless enough where we cannot
provide that feature. The primary reason being that the API only allows
paginating from the oldest commit to the newest, and not vice-versa. It
also doesn't really allow us to start at any particular revision. So for
now, we just have basic support.

This also does not support Kiln repository aliases.

Reviewed at https://reviews.reviewboard.org/r/6605/