Some fixes to remote url handling.

It fixes an issue with local remotes containing spaces, which could not be used since they were URL encoded
It also solves issues in windows with backslashes