Finished tree builder. It works, but requires meticulous testing. Also I
should revise grammar.