Programming Safely with Weak (and Strong) Consistency