Update generator to support python 2.6

collections.OrderedDict was introduced in python 2.7 so here we offer support for the ordereddict library as an alternative.