CMS-2007 Facet refactoring
Some minor renaming and change of use of variables.