Threaded GUI, added encapsulation, fixed framework