Fix #13 : Separate logic for relative/absolute and root/subdirectory checks

Previously, relative path from root were considered absolute and the call to
substring(1) removed a part of the path instead of removing a leading "/"
Now relative and absolute path are handled separately.