Reimplemented path manipulation function to use Apache FilenameUtils

We make sure all the FilenameUtil functions use the UNIX path separator,
which equals Constants.PATH_SEPARATOR