fixed some problems with the local database, code cleanup - now building class tree works again