Switched to a fixed and more complete `OrderedDict` recipe. Fixes #4912.

We could have fixed the issue just by implementing `iteritems`, but this is more complete.