Build the group tree and fill it with entries.