Made TextDocument.contents() protected.