mathlib: Matrix and Quaternion cleanup and bugfixes. Copyright updated.