Refactor menu and window code

Improves code spacing and organization. Shortens some verbose variable
names.