Implement ls command, improve some functions.

The ls method can work like the etcdctl ls command.