code tidy up, got messaging system working with web interface. Got ping messaging working