GPII-1239:  Tightened up cleanup code and startup checks based on pull request review.
GPII-1239:  Tightened up cleanup code and startup checks based on pull request review.

the-t-in-rtf/gpii-pouchdb,the-t-in-rtf/gpii-pouchdb,GPII/gpii-pouchdb,GPII/gpii-pouchdb