added missing methods to CPDocumentController

documentForWindow
hasEditedDocuments

both are in cocoa