Use context managers to properly access shelve data store
Make _inmem_{data,sets} class members of InMemorySession