Vectorize outerProduct
Vectorize many common functions