The current API for SortPairs with labels has a very bad ergonomics as the caller has to specify codes, which he/she might not be familiar with. We need simple constructors requiring by serializers/deserializers and using the default values. We also need basic serializer/deserializer implementations for primitive types.