Rather than building a tree from the expression (which is the recommended approach), I have opted to perform the substitutions in-place. This means that the result of an operation replaces the operation itself.
The reason I chose to do this, is that my parsing algorithm considers everything inside parantheses as a single token. Therefore, it is fairly easy to replace this token with the result of the expression within the parantheses.