Fix connection timeout and state determination.

* Handle with a connection timeout properly:
  now it's passed to zookeeper.init
* Proper determination of a connection state
  state is compared with CONNECTED_STATE
* Small amount of typo fixes
* Get rid of useless variables