Facets fix

When drilling the search results down by selecting a facet, the correct number is now displayed.
As far as I can see it's not necessary to delete items from `properties` as the loop below which accesses `properties` only uses `'ref:'` items. Removing these deletes would also mean you could avoid cloning `parameters` above.