formatHierHMM function

Convert hierarchical HMM structure to a conventional HMM