cleaned up global state, added help and quit commands, added TODOs
added some timeout stuff, removed ping code as not working