Fix bizzare initialization code for cuda and yet another problem with cublas init.

The latest fix has introduced another problem, this time with device=gpu.

Since we don't even call gpu_init() in that case, the cublas handle never gets initialized.  It split out the testint part in a new gpu_test() function and rewrote the gpu_init() function to always initialize the blas handle.

This is not tested because it is late and I'm tired.  So please test before merging.

I hope this is the end of the troubles with that part.