A now-former Connecticut elementary school teacher reached an agreement with prosecutors to avoid what could have been a substantial prison sentence over allegations that he inappropriately touched numerous girls who were his students over several years.