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.