Code

Change the way preferences are loaded to simplify unit testing