Wrote CAS for kvs, refactored kvs, also now I got a full understanding of the atomic-primops cas interface.