Add store parameter to give own database

This means that a persistent database can be used instead of the in-memory one,
or one which forgets items after a certain time.

This change is backwards incompatible though.