use polling instead of inotify with tailed files. also other cleanup