Refactored IDocumentState out of SwDoc.

Into the new class DocumentStateManager.

Change-Id: I91c9097b091ff6118d58fd15fff2a4cefe0171fd