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.
@smarterclayton - no objection. However, I thought we only added godoc to public interfaces.