Make the ConfigurationService independent of db
Testing notes
The changes on this ticket should cause no change whatsoever in the behavior of Optimize, since it is exclusively a code refactoring. So please run a quick regression test to make sure nothing has changed