Move mathex into core and inject its functions into global math table