etcd: move main logic to etcdmain subpackage