Add support for undeleting references (Fixes #2193)

Deleted references should be accessible via an explicit reference, and can be undeleted using "setdelete 0". Also the Resurrect function implicitely undeletes the given reference.
Merge remote-tracking branch 'scrawl/master'