BUG: Fix overflow/underflow bug in alpha-beta recursion

The transition probabilities were not scaled appropriately, causing
alpha and beta to drift to zero or infinity. Scaling them so that they
are basically valid transition probability matrices (each row sums to
one, or more accurately, D rows sum to D) fixes this problem that could
be seen when the length of the sequence was large.