Implement proposal 298-canonical-families.txt

This will improve the performance of legacy/trac#27359 (moved) by making more family lines match.