Make NumberFormats comparable for when they are used in dictionaries.
Add a test for _write_number_formats()