Network cleanup pt 1

Simplifies a lot of the network code, cleaning up a lot of unneeded copies as well as fixing a number of minor bugs.