Updates to allow multiple rewrite rules and rewrite rule/condition pairs

I believe I have setup tests and documentation correctly, but would love any comments to make this ready to merge.