We need `OrderedDict` support. So, as a last resort, provide our own.

* We try to import `OrderedDict` from the standard library, which is only available on python >= 2.7, if `ImportError` is raised we try to import it from `ordereddict`, a package available in PyPi. As a last resort, we provide our own implementation based on http://code.activestate.com/recipes/576669/.
* Update all code requiring `OrderDict` to use our compatible import module.