Optimized category tree menu rendering

Reduced number of queries