Port chain matcher from Brick
Merge pull request #21 from henrikbjorn/master

Port chain matcher from Brick