More networking code added

Still no functioning networking. Some multi threading will need to
happen next.