Normalize pathname for listeners, factories and root.