Sketch of idea for package to index data in etcd.  DO NOT MERGE

There are several components (apiserver, controller, scheduler) where we will want to:
- lookup an API object by key efficiently (without calling etcd).
- lookup an API object efficiently by something other than its key in etcd

This is a sketch of a more general mechanism.

Feedback of any sort welcomed.  I'm particularly thinking of @lavalamp and @smarterclayton who understand the etcd Watch interface well, which this would interact with.

Alternatives Considered:

We could write custom code for this in each binary that needs to do this.
That seems bad.

We could push changes into etcd to help us with indexing.
However, doing it in a go library allows:
- faster prototyping, without ruling out eventual contrib back to etcd
- control of memory size is responsibility of each go program, rather than etcd
- short-circuits the network path for mostly-read operations, with optimistic concurrency.


I was thinking more about the client -> server boundary where you say "post /bars" and get back a resource object, which hasn't yet been indexed.  The next time you say "get /bars" you won't see your new resource in the index.  In that case to get causal consistency for read-after-write the client to pass back a high water mark (resourceVersion or arbitrary) for that "get" that differentiates between "this doesn't exist" and "this hasn't been indexed yet".  So the simplest possible vector-clock.