Factor out branch and leaf nodes into node.h
Properly receive acknowledge messages on shutdown.