Remove directory per db invariant, and add a cleanShutdown implementation.