Implement BSD/Darwin (kqueue) and Windows (ReadDirectoryChanges) mechanisms
for receiving directory change notifications. Use events instead of polling
for changes. Retry file parsing up to 3 times before giving up.
Huge thanks to missionsix for preparing first two versions of the patch.