Sort all the trigrams before intersection

This is a major win for most queries.  On a production dataset,
this moves 8000 queries from 14.9s to 7.5s.
Remove O(n^2) loop from trigram indexing

Since most trigrams are unique, we were almost always traversing the
entire loop when adding trigrams.  This new approach adds duplicate
trigrams to the result array, but ensures they are only added a single
time to the inverted index.  On a production data set (~700k strings)
this sped up indexing by 25%.
Make sure the new trigram code has tests with duplicates