Converted pathwatcher to C, as part of #241.