Cleaned up cuda code. Transfer from python to cuda and back is now in binary
mode instead of text mode, makes it faster. Transfer is also via pipes using
python module subprocess instead of writing it on files. No disk writes required
to run code.