Split out gravatar methods a bit.

This allows us to get gravatar URLs both by User object and by email address.

Testing done:
Used in conjunction with some other changes.

Reviewed at http://reviews.reviewboard.org/r/4108/
Namespace uri_templates caching by base_href.

The uri_templates cache inside of resources was operating in a way that it was
global to the resource within any given server thread. This meant that if the
resource is namespaced in the URL (say, with Review Board's local sites), it
would sometimes return bad data. This change makes it namespace the cache using
the base_href, so there are effectively separate caches for each local site.

Testing done:
Wrote a unit test for this in reviewboard/webapi/tests.py

Reviewed at http://reviews.reviewboard.org/r/4107/
When serializing objects with expand, convert QuerySets to lists.

Serializing objects and expanding fields stored the fields as QuerySets
(when appropriate), but this meant that if something modified that list
before it was returned to the client, the data could change. It wasn't a
suitable snapshot. Now we convert to a list during serialization,
preserving the value at that moment in time.
Release Djblets 0.7.14.