Factor out the Avahi client code.