Major overhaul

Extensive changes so that the code uses Qt technology appropriately.