Everything in MainWindow.cs is now organized

Everything in MainWindow.cs is now organized into their appropriate
regions. Some stuff has been renamed to comply with the new standards.
Bug fixes.