Cleanup HTML: extract inline scripts, etc.