Connection management in main.
More stuff.
Added more stuff to modnet_daemon.