Cleaned, modularized, got it sort of working...

The core functions are now in rtutil. rtmotion seems to work, but the
motion transform is always 0 for the datasets that I tried. Also, the
histogram registration is slow (about 3 sec per volume). We should
switch to a fast RMS-error algorithm.