Support empty string as replacement and fix tests

This change allows using an empty string ('') as a replacement and adds a test for it.

It also fixes two failing tests by setting `mode: "rfc3986"` and adds two tests for the default `pretty` mode.