merge persistence mechanism into master

It isn't really finished, but it should be stable and so I want to deploy it with the logging