add TCPNetwork and overhaul network code
add TCPNetwork test