refs #14 Implement the preferences handling.  Partially plumbed in.  We
need to have UI changes to actually get changed in the prefs and stored.
Also, we shouldn't any longer ignore prefs or env if the variables are
not passed in the intent.