math: Added transform().

This transforms n-d vectors using n-d x n+1-d affine-like matrices. This is
important because all affine, non-projective matrix transforms have a bottom
row of [0] 1, and including them in the transform is not useful.