modified erase_obj() to delete both files and folders, code clean up, data structures renamed