Extract isRelative to LJSUrl.
Remove duplicated code.
Handle undefined/null URLs.