I removed this whole block because

1. There's a set of just above it that accomplish almost exactly the same thing.

2. There's really no way I can think of to implement this exact functionality without overriding cd. If this is something we really want then I'd recommend forking it out into a separate plugin that people can choose to source. Call it `directorynav` or something.