Consistency Types for Safe and Efficient Distributed Programming