Simple pattern matcher. First commit.
Added unit tests.