The problem is that there's too much data variation between individual mobs, even of the same type. Most of the basic sorting mechanisms will treat items as different if ANY part of the NBT data is different (or will ignore the NBT entirely). Neither of that is what you want.
Your only hope...