Hi David,
I was finally able to get some time to look at this. The listItemCreated function actually gets called multiple times (map initialization and at other times) and this is likely why you are seeing the misleading layer count info. We've actually fixed this in the next version of the API where the function will only be called once. I moved the log statement to the bottom and have it simply logging out the layers collection and there is only one layer for each category.
To remove the layers without any sightings from the layer list you can simply set the listMode to hide for that layer. I modified your logic slightly to show this on line 299 of the codepen below. I hope this helps.
Here is the codepen I was playing with. https://codepen.io/sagewall/pen/abMNeZQ