Port GUI frontend and support code to python2and3