Add transpose and idSElim as primitives and make abstract several things