Wait for connection before starting backup/restore

Improve ZooKeeper connection handling to wait for SyncConnected event
before proceeding. Remove ZK factory classes in favor of a method in
CommonOptions. Upgrade dependencies to the latest.