Split monolithic document class into separate document and window controller.