Gui separation

Separated GUI completely from logic, multithreading also added