write call on most systems. Avoids problems with interleaved debug printf from different processes. Also remove an extraneous error case since recv() can't return a short read and add some more XXX.
most the actual work. Currently relies on dynamic loading using dlopen(). See doc/plugin.pod for the plugin API.