RFC: generalised cat implementation

This commit adds the generalised cat behaviour discussed in #7555 . It was suggested to call this function `dcat` with the d referring to the diagonal, since this method allows you to construct a block diagonal matrix. While I have followed this suggestion in the current commit, I am not sure whether I still agree with this choice. A block diagonal matrix is only the special case you get when 'catting' matrices and choosing `catdims=(1,2)`. For `catdims=d` an integer, it just does the same thing as the current `cat` for arbitrary multidimensional arrays and I believe this is the proper generalisation of that function for `catdims` equal to an arbitrary list of dimensions. So my suggestion would be to have this method as a replacement or additional method definition for `cat`. Comments are welcome. When everybody is happy, I will add test cases.