Renamed methods from *CompoundDocument to *RichDocument.
Minor fixes and cleanup.
Fixed C# compiler.