substitute for OrderedDict when not available from standard library