States

This defines a json format to serialize and restore an entire glue session. This is not yet exposed in the GUI, because some additional pieces still need to be added.

The JSON serialization also refactors the code to make it easier to get and set essential state information in several places.

Finally, it uses this new framework to add an "export to D3PO" option