Replace hand-baked enums with the 3.4 enum class