url: fix/8722

This patch attempts to close this issue #8722:
- [x] feature
- [x] test
- [x] documentation
- [x] fix some style conflicts with `jshint` in test-url.js

R=@indutny :cherries: 
and for given pseudocode by last last comment, in `path` case, we should only touch one of `query` or `search`, because in `path` they are overlapped, so i choose `query`, `search` will be reassigned next code, so i propose the program will be:

1. if it contains "?...", than replaces the current `query`
2. if it doesn't, the current `query` is used of course included `search`
3. if it contains "#...", then replaces the current `hash`
4. if it doesn't, the current `hash` is used

> query is more specific than search is more specific than path -> search wins

from my above statement, i guess we shouldn't touch `search` any more, just follow the step 1.
@chrisdickinson how do you think about my idea?