Added function that checks if the array is a gpuArray and gather it if it is. Saves time putting in endless if-then statements so the code works whether or not the machine is GPU-enabled.
Changed tryGather from using a try-catch to using 'isa'