Cleanup of Qt code

Removed some repeated code, fixed some warnings and other minor fixes.
Also implemented frameskip option and auto selecting the first display list in display list debugger.