Allow more sophisticated base_url

If the base_url contains a query and/or a fragment, then the locatePath() delivers incorrect results. Example:
```
base_url: http://www.example.com/subsite/?language=de&abc=1#anchor
path to visit: /user

Result wrong: http://www.example.com/subsite/?language=de&abc=1#anchor/user
Expected result: http://www.example.com/subsite/user?language=de&abc=1#anchor
```

This code is going to deal with all possible cases.