Make Pair.invert return a Pair, rather than an Enum

(or anything else that inherits from Enum)