Move print_backtrace() to separate file and call it on any CUDA error
Switch to correct CUDA context before disposing of objects

refs #150