Added MathUtils class, moved some of the methods from Utils to it.