Add support for saving/restoring sessions.