Bugfix/cleanup checkpoint

This pull request contains a ton of stuff. All of it is related to reworking the CleanUp operation to merge databasefiles always and no longer use purge files to reduce the number of complex situations that might otherwise come up. 

Related issues: #266, #268, #265, #208.