Fix `Context.fromfunction`

On top of #354.

1. `Context.fromfunction` was broken client-side; fix it.
2. Add a test and a docstring.  Fixes #156.
3. Have `fromfunction` use the new version of `from_localarrays` under the hood for communication efficiency.  Partially addresses #337.

`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`.