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.
Merge pull request #14 from juliencampergue/master

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