[functions] update function interface

The function interface now allows arbitrary numpy array valued
functions. In particular, 0-dimensional arrays are allowed. On the
other hand, dim_domain >= 1 is now required. This ensures, that
f(x, mu).shape == x.shape[:-1] + shape_range
is always true.