Moving init code to lib/hdf