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

The purpose of this change is to allow core parser and client to work with other resource codecs that know how to encode/decode custom types.
Sorry to be a pain, but can I talk you into just using the runtime.Codec interface? Since this already links with runtime...