Sort items before serializing to minimize diff