Extract several kubectl helpers from cmd/cmd.go
Merge pull request #2258 from fabianofranz/expose_cobra_helpers

Extract several helpers from pkg/kubectl/cmd/cmd.go