A cleaned up version of mathParse

Because of a lecture on lexers and parsers today, I took another look at this code. I factored some repetitive code out into a function and fixed a problem where multiplication and division were parsed in the wrong order.