Initial work on tree standardization

Some small programs can already be standardized correctly, but this work
is largely indended to flesh out the structure of the standardization
code.