tweaks to preferences and preferences_test

This has some tweaks to the use of Futures and to the test code.