Better faceting, and some tests.