Added functionality for sending and receiving commands via network

Todo: 1: Write routines for handling commands. 2: handle lost
connections.