Improved support for multiple alloc and dimshuffle alloc combinations and added assocaited tests.