Resolve issue #29

Make a few alterations to getting $url and unset $path[0] if BASE !== $_SERVER['DOCUMENT_ROOT']
$url is built using $_SERVER['REQUEST_SCHEME'], $SERVER['SERVER_NAME'] and
$_SERVER['REDIRECT_URL'] or $_SERVER['REQUEST_URI'] (depending on if $_SERVER['REDIRECT_URL']) is set