On the Trace Product and some Families of Languages Closed under Partial Commutations