replace some of the rotations module with c++ functions

I only replaced the ones that were actually a bottleneck.  We can
replace more later if others become a problem