Introduce DataSetStorage interface

First step towards making this more testable.

Also has the nice benefit of extracting mongo functionality out into
separate file.