Make scan work with new backend.

The scan op part should work, but the optimization that moves the scan inplace has some problems.

Since I share the 'gpu' flags with the old backend, the opt that move to inplace using CudaNdarray goes first and fails because it's using the wrong type.  I guess that my version goes after and works correctly, but this still prints a scary warning.