[WIP} Added a WIP array.mean() implementation.

Related to issue #828 and some others.
I'd rather see the tests expressed explicitly using helper functions rather than this kind of test generation, which becomes quickly unreadable.
(yes, we do it in a couple of places, but only when other approaches would fall flat)