Work on getting document history back and being able to delete documents

todo: refactor mysql impl. to have common document id method?
For whatever reason git didn't want to add these two to the last commit.