etcdmain: extract etcdFlagSet from main function

1. This makes code easier to read.
2. We are able to do unit tests on our own flagset.
3. Get rid of global variables.

helps #1399