Resolves and tidies a relative path against a base path or URI. Given only a basePath, simplifies it.