Added options to specify hdf5 or pickling as the saving format.