Testing of Viterbi
Some optimisations
Hypergraph pruning.

Need to elaborate test, do some more checking and connect to
rest of code.