Initial conversion to NSDocument based architecture. Much work still to do.