Major update to networking code.