Database file with database model.

This version used the sqlite database file as the dataset for the model. This turned out the be slower than keeping the dataset in memory so future commits will revert to that scheme.