Made more progress with the Patterns integration. Added unit tests to make sure that the Pattern things are working as they should be.