Added sql support to model for fast querying of datasets

Uniquity needed a way to generate query sets from
the huge amount of data gathered from scans. I
decided sql was preferable over writing custom
application code to generate the same reports.
Some test code still exists to demonstrate the
alternative method, which will be removed by
the next commit.