Automatic connection management and dependency tracking