Fixed ConfigWriter to output database configuration.
Fixed ConfigurationImpl so it copies the database.
Fixes to the integration tests.
Added integration test for DebugCompare.