Revised menu loader so that it works identically under python 2.6 and python 2.7

Note this includes code from the 2.7 standard library, if anybody knows the 'proper'
way to acknowledge that let me know...y