Changed some variable names to clarify meaning.

It was unclear that the bounding rect was for the prefix string.
Fixed a compilation error.
Renamed the color ranges to be semantic rather than visual.

Now the range that is grey is the "matchedRange" and the rest is the "completionRange",
in line with what they actually represent.
Clarified some comments.
Cleaned up some boolean logic.
Consolidated identical logic into one method.
Replaced an NSInvocation with a direct call.
Replaced a performWithSelector with a direct invocation.
Fixed the out-of-bounds crash.

Added a guard, and changed the way a selection was handled to take orientation into account.