Rack-based HTML rewriter