added tests for magnitude, fixed calculation of vector<4> magnitude