improve menu rendering performance

Improve rendering of CommCare HQ menu from `5.73126 s` to `2.10069 s` by doing a double pass to find the active item.

First pass is simple URL check. If no tab matches then proceed with slow pass.

Before and after profiling info here: https://gist.github.com/snopoke/8847121b9d9562eda024