Refactoring and better tests for hdf5 catalog