Add Window.Id(), various refactoring.