Rewrite url rewriting

This is a proper url rewriter. The edge cases it has will be in CSS and
JS files and style and script tags. Those are much harder to deal with,
so I'm going to not deal with it now.

Fixes #29