Illegal chars

Replace URI reserved chars with a tilde (`~`).

This pull request is based on #30, merge that first. Only the latest commit is relevant to this PR.

Please review, @cfaessler.