Refactoring in Config->__construct()

Put the $_SERVER['HTTP_HOST'] fallback in a more logical place.
Robuster determination of "base_url" config item

Remove the basename only at the end, to avoid edge cases.
Different method for determining "base_url"

Better performance by not using regex.
Remove test that has become unfit
Remove spaces around concatenations

per request
Yet another method for determining "base_url"

This one is great because we don't have to deal with the special cases:
* in Windows, dirname('/foo/index.php') gives "/foo", but dirname('/index.php') gives "\" instead of "/"
* dirname() doesn't include the trailing slash, with the expection of "/" (root)

props @narfbg
Add test for "base_url" determination on server root
Discard the unwanted changes
Merge pull request #2981 from vlakoff/base_url

Work on determination of "base_url" config item
Optimize #2982