Massive refactoring. Add Qt4 version.