Fix `Context.fromfunction`

On top of #354.

1. `Context.fromfunction` was broken client-side; fix it.
2. Have `fromfunction` use the new version of `from_localarrays` under the hood for communication efficiency.

`fromfunction` is an odd function, and the numpy version can return arbitrarily-shaped arrays.  This one is more restricted, but I think it supports the common use case for `fromfunction`.