Trees.fold now works with keys