Added type passing into transformations for consistency, and in order to prepare for transformations on the types themselves. This is necessary for support for empty arrays, since we cannot inspect the terms themselves in order to correctly deduce the target terms.