Fixes the aggregation preparation rewriter to handle
expressions with dependencies between each other

o Fixes #1897
o Change RandomNamer to generate ASCII names