Fix for issue# 8890: commonPrefix does not handle unicode correctly.

It was returning partial code points if the first few code units in a
code point matched but not the entire code point.
Slight tweak to commonPrefix's template constraint.
Fix commonPrefix so that it can mix strings and other ranges.

The fix for 8890 made it so that commonPrefix could no longer compare
strings with ranges of other types. This fixes that.