Send packets instead of messages
A few fixes and improvements on the network code