Merge Paths function to avoid creating double slashes when generating source URL's

In a scenario where your base path is a single slash (default case) the current implementation will create a leading double slash which in turn will cause Chrome to treat the URL as full url so Chrome
//documentation/bla/bla/blah
 will go to 
http://documentation/bla/bla/blah
The function just makes sure that no double slashes occur.