Add write API with append data functionality
Introduce DataSetStorage interface

First step towards making this more testable.

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