UUID/PyQt crash workaround

This fixes #775, and tidies up the GafferUI module a little in the process.