Change get_localarrays, add get_ndarrays.

get_localarrays now returns LocalArray objects.
Add tests for get_localarrays and get_ndarrays.