Refactor the inotify based file watcher in preparation for creating a inotify based tree watcher.