Refactor tkinter UI to use timers instead of threads