Basic Functionality

Settings save state on application exit. The added code is reaaallly
ugly though.