Proposed fix for #1280

This PR proposes a fix for #1280, and #1676.

It is not ready to be merged, as I need a few more tests. 

Input for tests are very welcome.
I fixed the issue you raised @thecodejunkie, and have added two unit tests. One that is red and illustrates the problem with System.Uri and escaped forward slashes.