Determine nav tabs based on active trails. Fixes #432.