util.supports rewrite [WIP]

This currently fixes #93, but there's still a bunch of FIXMEs we should address here--need to do a bit of empirical research.

@ericz