wconnect: add protoypes, move arg-checking and auto-rooting to main
wconnect: move main to the top
wconnect: push ifdev call to main()