Unit tests and fixes to display_prefs model (ported from Python app)