Version and encoding consistent ordering

These are sets in Java land, yet they must have consistent ordering for read hashes to work, and avoid unnecessary writes.