Finished converting to C++

All structures are implemented as classes with overloaded operators for
device code.