Make more tests use the PreferencesExtFactory.

When tests are run in a big batch, the first using Preferences needs to
set this factory or else none will get it.

This fixes running the UI tests on Jenkins.