Optimize dir() into MMD candidates

And make dir() use the currently active $*SPEC to determine what the string
for current directory is.