Get documentProvider.save tests

Description:
Also, the dbOpen and dbExists functions now both return a promise.
Before the deferreds were being passed by reference. Tests have been
updated.