Performance and bug fixes

Performance: viterbi lookups, binary serialization
Fixes: serialization mixed up the states