Initial refactoring of etcd lookup plugin.