Rename HostingServiceRepository to RemoteRepository and add new fields.

This standardizes on RemoteRepository as the name, which matches the
name of the upcoming API resource. It also adds some new fields to the
resource for storing the unique (per-service) ID of the repository and
the HostingService and account that the repository is linked to.

While in here, I noticed that the wrong field was being used to fetch
the repository's URL for GitHub. This updates to use `clone_url` instead
of `url`.

Reviewed at https://reviews.reviewboard.org/r/5896/
Provide reasonable defaults in get_remote_repositories.

get_remote_repositories() can now be called without passing any
information. Subclasses are expected to provide reasonable defaults,
like the account's username for the `owner` parameter.

Reviewed at https://reviews.reviewboard.org/r/5897/
Make the ID checks more restrict in the webapi test URL functions.

This enhances the logic of the various get_*_url() functions to be more
strict when they're willing to accept either an ID or an object.

A new function, _normalize_id(), checks if the value is an ID or an
instance (or subclass) of the allowed class type. If it's not any of
these things, then a ValueError will be raised.

This reduces the complexity of the code in the functions, prevents
duplication, and adds enhanced error checking.

Reviewed at https://reviews.reviewboard.org/r/5898/
Add unit tests for HostingServiceAccountResource.

This resource never had any accompanying tests when it was first
written. As we made changes to the resource or any other backing
services, we had no way of verifying that the code worked through the
API. It turns out, it didn't, as POSTing ended up calling save() on the
wrong object.

This introduces a basic test suite for this resource.

Reviewed at https://reviews.reviewboard.org/r/5891/
Add a link in the HostingService API to related accounts.

The HostingService resource now links to the HostingServiceAccounts
resource in order to easily query all accounts associated with that
service.

This required adding some filtering abilities to HostingServiceAccounts.
Callers can now filter on username or on the service ID.

Reviewed at https://reviews.reviewboard.org/r/5889/
Add a link in the HostingService API to related local repositories.

This adds a 'repositories' link in the HostingService item resource that
points to the Repository list resource, filtering on the given
service ID.

Reviewed https://reviews.reviewboard.org/r/5892/
Make use of FileDiff.is_new.

We have a property that does the comparison against PRE_CREATION for us, so we
might as well use it. This is just a simple cleanup.

Testing done:
* Ran unit tests.
* Checked diffs for new files.

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