Delete a document and clean up all references to it