more code refactoring for redundancy reduction
* vector typedefs back to Matrix<> instead of Vec<> (caused internal compiler bug in VS12 in some cases)