Fixing backend sub-menu navigation selection by making match_path for tabs work. Tests included now.

Fixes #3683