refactored script to use a class
added gtk interface
added new commandline switch to use ui or commandline