Make api able to marshal its types correctly

This frees everyone from having to think about the "Kind" field: use api.Encode and api.Decode[Into] instead of json|yaml.Marshal/Unmarshal.

To make it easy on tests, I'm also making the rule that the Kind field is *not* set in go objects. Since we already know what type they are, it's not needed.

I also switched some types that we were passing as string but converting to []byte everywhere. More efficient to pass as []byte, anyway.