Added test
Refactored MathExpressionParser from lpg to here