Got the modularity at the very least partially implemented. The window
now closes before the log deposits its data into the file so there is no
delay between button press and window close. 20 seems to be a good
number for the timer, but that probably needs a bit more tuning.