Added basic emitTree(). Not quite there yet though.