When looking for linked URLs at the same depth use the folder of the current URL, not the entire path
Canonicalize URLs. Fixes #7

Function kindly borrowed from http://php.net/manual/en/function.realpath.php#71334
Rework curl $newUrl logic