Clean up categories display logic

Once again I moved logic to controller.
Only second level categories can be opened in my variant, as it seems you have pretty tricky logic in Coffee Script.