More refactoring, cleaned up mouse and graphics, prep for single window interface