Use codec to encode/decode api objects in client and kubecfg parser

Corresponds to upstream PR https://github.com/GoogleCloudPlatform/kubernetes/pull/1115