Added Db.Unload, its implementation and test. Fixes #1911.
Fixed bug in unload.