Initial work on simplifying and making the main loop more robust
Initial work on simplifying and making the main loop more robust

cyflhn/go-zookeeper,mikeqian/go-zookeeper,wickman/go-zookeeper,ngaut/go-zookeeper,aybabtme/go-zookeeper,theckman/go-zookeeper,mondough/go-zookeeper,helight/helight_code,kmiku7/go-zookeeper-annotated,dallasmarlow/go-zookeeper,helight/helight_code,helight/helight_code,helight/helight_code,cch123/go-zookeeper,helight/helight_code,rajivreddy/go-zookeeper,hailocab/go-zookeeper,helight/helight_code,lightpaw/go-zookeeper,helight/helight_code,helight/helight_code,figoxu/go-zookeeper,helight/helight_code,tempbottle/go-zookeeper,go-cloud/go-zookeeper,ChannelMeter/go-zookeeper,zenoss/go-zookeeper