Pull out some localarray testing functions

and put them in testing.py.
Rename fromlocalarray_like -> fromndarray_like,...

... fix it, and add a test for it.
Add a test for localarray.empty.
Refactor a couple of tests.