Remove declare-modal-file-viewer and refactor usages