Preferences

Rebased against new master.  Added Function to initialize preferences values.