Moved from shelve to sqlite (together with other minor details).