Higher level IPC abstraction (fixes 238)

This is mostly refactoring.

Fixes #238.
This doesn't appear to actually use ZFS.