Updating StateApplication so that it can be configured to restore state based on previous execution state.