Better network code and persistent data

This patch covers the much needed network code as well as adds
persistence to the data. Neither of these are complete, but in an
effort to reduce the complexity of these commits, this will be a
temporary measure.