Use OrderedDict to define menu items and simplify code

A compatibility class was added since collections.OrderedDict appeared in 2.7
See:
https://docs.python.org/2/library/collections.html#ordereddict-objects
http://code.activestate.com/recipes/576693/