pub fn normalize_path(path: &str) -> String
Normalizes a path by collapsing duplicate slashes and removing trailing slashes.
Preserves the root / path.
/