Added initial support for serializing break state

Currently this isn't hooked up to anything: we just output a json stream on exit. In the future, this will be useful for storing state between sessions, and sharing state between systems.

We use our own simple (and ugly) serializion / deserialization interface, instead of Json.Serializable, because we need to deserialize json data into existing objects.