refactored backward and forward algorithm. move common code to base
class 

keep track of all scale up factors along the calculation in an array
implemented Baum-Welch algorithm