Wales international scrum-half Richie Rees will leave Edinburgh at the end of the season to join Newport-Gwent Dragons.