Add a method to invert key-value maps