Refactorings.

Moved functionality from new_integer to main, where it belongs.
Also made a convenience class BitMatrix (which only "works" for CPU
bit matrices, as GPU ones are treated specially).

Probably lots of compiler errors as I don't have a cuda card to
compile on.