Closes #192 Improved CategoryManager and tested

* Refactored a little bit the manager, following some good practices
* Also placed the QueryBuilder build in the CategoryRepository
* Added two useful methods in WebTestCase:
   * flush($entity)
   * clear($entity)