Group compiled patterns into an object.

Closes #157.