Compile fix for VC++
Initialize variables.

Fixes the "why do we do this right here?" loop, which otherwise leads to access violations and releases non-existent CUDA arrays.
Move some code into a .cpp file and add a method to display the current CUDA memory usage.