[ty] Refactor how we sort completions
This should be a non-behavior-changing commit that tweaks how we rank
completions. We now use a wrapper type and include the module name for
more precise sorting when relevance and symbol name are identical.
The purpose of this is to prepare the code to switch to a max-heap.