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.  Fixes #942, which was not, in fact, a configuration issue.