sorting entries in annotation_set_item and elements in encoded_annotation