Simplified Document.get_contributors to prevent serial database queries.

Also simplified gravatar helpers to not have to rely on the user profile for reduce reverse relations.
Merge pull request #2504 from jezdez/contributors-speed

Simplified Document.get_contributors to prevent serial database queries.