Sort map keys when serialising map fields to binary and text formats.

This gives deterministic output, albeit somewhat inefficently.
I expect the inefficiency to be dwarfed by the reflection involved
anyway, but it's easy enough to improve this later if needed.
3 files changed