Thanks for posting this. A few questions (I know this is six years later).
In your call to Subexpression, where do 8 and 4 come from? Are they from manual inspection?
Could you show the proper usage of your functions for a very simple example like expr = (a + b)/(2 + (a + b))?