A JS port of a tree generator I wrote for classes in December 2010.