Sort the results in the user autocomplete better.

The results in the user autocomplete are basically in the order that they come
from the database. This is kind of crummy when there are multiple matches.

This change adds a sort comparison mechanism which will sort all username
matches ahead of real name matches. Within those categories, the names are
sorted in alphabetical order.

Testing done:
Added a bunch of users with usernames that started with a common substring, and
a bunch of users with first and last names that started with the same
substring. Saw that when I put that substring in the "People" field, the
autocomplete results put all the username matches first, and all the realname
matches after.

Fixes bug 2107.

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