Import and export of sessions as proposed in issue #460

Using json to store and retrieve session data.