fix bugs in sum log probe when dealing with infinite values
refactor chain model to make fast fb/viterbi more generically available