Support counting matching triples in a store.

Closes #25.