Javascript shunting yard algorithm to parse mathematical expressions and calculate the resulting value