Allow in-memory database

Closes #639