Tried to add threading, failed. Most of the code is still in there in case we keep it for some reason, but it's unlikely.

Basically, Tkinter doesn't work if it's not in the main thread. I'm going to look into some other threading solutions; we'll see.
Fix merge conflicts.