utils: add stacked matrix/{matrix,vector} products

Add two functions which interpret multi-dimension arrays as either
arrays of 2D matrices or arrays of vectors and find products between
them.

The functions make use of the numpy 'einsum' function which provides
very fast products on large arrays.
registration: make use of stacked product routines
utils: add stacked vector/matrix product
registration: use stacked vector/matrix product

Instead of transposing matrices, we can use the stacked vector/matrix
product directly.