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).
I was just thinking that it's nice to have both vars scoped only in the if statement. Otherwise you have to declare them both outside the if statement-- Brendan's code won't actually compile because of the scoping of "version".

I can change it though.