Fixed some bugs with the messageboxes. Boxes were popping up duplicates, so the message and receive flags were not being updated before another gui check saw them. A lock may be the final solution if this keeps being a problem, but decreasing the time in the controller of checks and increasing the time of the check for message loop in the gui seems to prevent these collisions. I also added a wait between successive popups so that the user doesn't accidentally click OK for them both.

There was also an issue where the user would hit enter accidentally, which would cause the loop to continue, although the user hadn't done the necessary operations. I have added a quit button to all the messages which terminates the process and the regenerate thread, and I have set this to the default. Accidentally stopping the cycle is annoying but it won't hurt the system.