Cython implementation of OrderedDict