What determines when cities or resources are connected to the trade network? This seems obvious, but it sometimes resources right next to my capital are automatically connected as soon as I build the appropriate improvement on the tile. That is, I don't have to build a road at all. This might have something to do with whether there's a river there. Also, it seems like my cities will connect themselves automatically if there's a river between even if I don't have sailing. Some of these things might be messed up by various mods, but what is supposed to happen by default?