Fixes to MIT theme tab colors

Previously the correct tab color for a page was not selected in many
cases.  This fixes the bug and also cleans up the function that's
picking it.
Refine tab guessing algorithm to use largest number of matching characters
Choose closest tab match from all links in nav structure

This no longer requires the beginning of a URL to match the
"header link" in the nav structure.  Also, checks to see if the
top tab (header link) is the best match, in which case the
desired tab index is 0.
Merge pull request #945 from learning-unlimited/fruitsalad-tabs-fix

Fixes to MIT theme tab colors