Add documentation to network stuff
Make it possible to shut down cleanly