[Tests] TestDeleteDocument now passes.

Completed the port of all changes from the first sharpen snapshot
to the second. Fixed a few issues related to refactoring.