Refactoring of hope-fear decoding from kbmira
complete refactoring of kbest mira