Added Preferences

Added Preferences popup. The popup is incomplete, but the treshold tab
within has a pretty good start.