Format the given path so that it does not have trailing slashes and also correctly appends a path.
The base path to start from.
A path to append to root - may itself use ./ or ../ segments.
root
./
../
Format the given path so that it does not have trailing slashes and also correctly appends a path.