Added support for import / export state reporting.

This adds basic support for import and export state reporting. See `README.rst` for details.