Fix bugs with thread separation.
Remove possibility of deadlock by making messageboxes be called from GUI thread.
Also amazing system of sending messages back to GUI was added.