Use collections.OrderedDict if its available