Use a PID file
Do call unref()
Only log events when new ones are encountered
Fix comment to indicate configurable timeout
Add support for repositories