This function returns the number of leaves in the parse tree of an
expression. The motivation is to provide an initial complexity measure
that could be used to decide whether or not to apply some simplification
rules. Docs, embedded docs, and test cases are provided.
Resolves#2389.