Persist preference window

This fixes issue #3.