Reimplementing average

Core does have average method, and we can do one core call instead of one. Moreover, this PR makes it easier to change the size of the test (the constant `TEST_DATA_SIZE`).

@emanuelez @bmunkholm @cmelchior