Abbreviate SHA-1 commit IDs.

If a review request is created with a SHA-1 as its commit ID (for example, when
using post-commit for GitHub), the long string of text will push everything
over, making the UI very ugly.

This change adds some code to abbreviate 40-character strings.

Testing done:
Created a post-commit change and saw that it showed me an abbreviated SHA
instead of the full thing.

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