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)
Merge pull request #198 from elcodi/feature/improved-category-manager

Closes #192 Improved CategoryManager and tested