Use collections.OrderedDict if available.