Revamp storage of settings and current state.