N-dimensional ACF calculations

Generalised `autocorr` code to work on N-dimensional arrays, given an `axis` parameter.