Categories counts in models

Moving categories counts in the TopicCategory model drills down the number of db hits needed to render a page from around 850 to 140 (search page), speeding up the rendering a lot.
In order to make the test pass (due to new signals), I moved all the core test data (layers, maps, documents and users) to the search system (creating objects through ORM) limiting the use of test fixtures to what is not signals dependent.