MDL-41811 simplify the admin tree detection logic and fix navigation in multiple areas