new delete functionality, tests for deleting and reinstating documents