Make scan work with new backend.
Add the inplace opt.
Add a way to differentiate the old and new gpu backend in ScanInplaceOptimizer.
- clean up imports
- Add opt to lift HostFromGpu through Rebroadcast
- Add broadcast pattern check on the GpuAlloc opt.
Fix a bug in the scan to gpu optimization and add some tests for Scan.
use safe_to_cpu to transfer output results in op_lifter, since some ops return some results already on the cpu.
This should get scan working with non-float32 inputs/outputs in gpuarray.

It should also not break the old cuda backend.
Fix cuda opt.
Remove the 0-ndim restriction on GpuElemwise.
Check that there are no transfers in the inner loop with mixed inputs.
Add test for Rebroadcast on GpuArrayVariables
Merge pull request #1807 from abergeron/gpuarray_scan

Make scan work with new backend.