Replace `collections.OrderedDict` for compatibility with older Python versions