Determine `@local` function context from DistArrayProxies.

... instead of requiring / allowing users to explicitly use a `context` keyword when using functions wrapped using `@local`.

Also, add some utility functions to help with this, including `all_equal` (which determines if all elements in an iterable are equal) and a function `determine_context` which does the main work for this change.
Add tests for new subcontext functionality.

Also add tests for supporting utility functions.