Add support for asynchronous state saving and loading.