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/