CUDA fixes
fix tests:
 - std and var do not have multi-dim implementations
 - do not use square matrices for tests, hides corner cases
 - randomize the size of the matrices used in tests
 - fix x:mean(dim) call to divide by the size of 'dim'.