Rework model to support pattern property.
Adding pattern unit test.