Separate DB for transient data, misc. code cleanup