make stats functions use dimension-count instead of count to ensure
functions work with arbitrary core.matrix arrays