Moved Peer and Server logic into classes.
Basic implementation.