Move some code
Clean up mat*vec signature
Fix near_equal() funcs to deal with NaNs correctly
Fixes and clean up --> global vectors work with dmd correctly

Global vectors won't work with current gdc or ldc, tho.
Make global vecs work with both dmd and ldc. No luck for gdc.

Also, add tests for this!