Read in preferences and store in globals