fixed bug in Matlab simultor. Rewrote libdai code related to HMM and HSMM to be more modular