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
Added functional tests with parameters including blank spaces
Merge pull request #676 from volaya/spaces

some fixes to remote url handling.