SW-96. Make export packets checkbox consistent with application state

Also, other code cleanup. See the individual commits for details.