real-math: rearrange vector implementation code in anticipation of templatizing vector classes