Minor refactoring and commenting.
Added 'tree' to package list.