Major cleanup to network code, design is coming along much nicer.