Check if the path is absolute using path library

Removed UNIX specific check by replacing it with a check using `path` methods.