Make histrange us the extrema function

And add a simple test for hist()