Implement modal layers for dired-mode.