Fork API types.

All tests pass (for now...)  Rebasing this PR is a _pain_
Ok, switched to Encode (except in two places that deal with etcd directly)