Issue 512 facets

See #512.

Depends on #523.