Added support for HDF5 output. HDF5 output will be used if the specified
output file ends with ".h5" (Requires OpenGM)