utils: finished rewriting translate and match_stars

ref #93, #94