Many bug fixes.

cuda backend almost working.
Fixing the ExchangeHalo to work with backend interface.