Fix facetize function to store all facets at once rather than use addToSet