Merge rewrite into master

This basically nukes master and then merges the rewrite on top of the scorched earth. Only sane way I could think to do this given that the rewrite was never branched off master in the first place.