Move the stack logic to the directory visitor

This will enable us to implement renaming filters in an elegant way.
The renamed path components will be added to the stack.
Implemented renaming filters