Add tests and flesh out API for conditional put - TODO: make it work