Decode/Encode everywhere

Necessary for Brendan's upcoming api versioning PR. This is a fixed version of #567.

All types stored in etcd are now API objects.
>This means I made an api.ContainerManifestList, and added a JSONBase to endpoints (and changed Name to JSONBase.ID).
nit: I prefer the exceptional case in the if condition:

if version, ok := ... ; !ok {
  return "", "", fmt.Errorf("Unregistered type: %#v", key)
}
return version, t.Name(), nil