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.
I kind of hate named return.  (well, I don't mind named values in the signature, but I really don't like the empty return.  I think it makes the code a lot harder to read.)

In general, I think this means we should have some generally accepted style guidelines beyond basic Go style.  I'm ok if the consensus is named return is ok, but let's have the discussion ;)  [to the IRC channel, batman!]