Moved MathTools into its own namespace and created a lua library for it. Also renamed a few mathtools files. This is to allow flexibility for future refactorings.