Story24 hdf

This is a lot of code related to generating the HDF file. Can we please extract that into a separate function? I suggest to write a module specific for generating the HDF from a given JSON structure (aka the data pulled from MongoDB). This will allow us the to test the HDF generation and maybe even reuse it in other projects later.