Add vectorize decorator.

Analogous to NumPy's vectorize decorator.