Support for inotify

I've added support for inotify, if is is available on the system. If not, the old mechanism will be used to monitor changes.