Finish some final refactorings on the network handling code for 1.7.