The replace_headers method had to be moved since the async_impl module is not compiled while compiling to wasm. This caused the replace_headers method to be unavailable. fast_random had to be excluded from the wasm build to prevent dead code warnings in the wasm target.