String equivalence classes

cc @mwhelan