WL-3156 Add test isolating behaviour

The locations and categories appear to be acting inconsistantly.
WL-3156 Fix code when fetching categories

Not only was the code in `getAllCategories` doing the wrong thing, it was
interfering with the cache for `getAllLocations`.

I have changed the code to match the format in `getAllLocations`.