Added topleveltools.persist() and agenttools.PersistenceAgent.

The PersistenceAgent exposes persistence functionality to users. The names are
provisional, but "persist/persistence" seem as good as "write/writing".