Duplicate fw detection and main_category API

* Change main_category API for direct acess
* Add and change tests around main_category access and detection
* Add other tests for duplicates categories and framework, to ensure they
  are ignored