daemon: Move 'exists', 'is-file' and 'is-dir' to separate file.