autocomplete: sort usernames by indexOf then length

Fixes 1866.

Theres another odd bug (?) where autocomplete doesn't seem to filter properly until you've typed at least two characters. Not sure why.