Add preliminary HDF5 support.

Also output the data in an HDF5 file (<prefix>.h5).