Refactor solver.py to use a TranslationInstance class