Fix hasCategory to return True for (not yet loaded) dynamic flag categories. This works only for the top-level category but not any sub-categories. Also add unit tests.
hasCategory
True
cc @wlampl @tbold @tadej