DRAFT massive retrofit of code; better organization and style across the board. Also some mouse wheel zooming.