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

Extract several kubectl helpers from `pkg/kubectl/cmd/cmd.go` to its own helpers file and exposes them so that other commands can make use of it.