Moving directory watching utilities to shared_core.