Partially fix the PreferencesManager integration test.

Only a partial fix because that code is going to change anyhow
(to support path-based rather than project-based preferences)
Support inserting and deleting levels in MergedMaps.