Refactoring for posterior model saving and analysis. Ensure database is connected to model when skipping sampling. Added support for non-pickle database backends.