Extract connection checking logic from expand_module in hierarchy.cc
Extract connection checking logic from expand_module in hierarchy.cc

No functional change, but pulls more logic out of the expand_module
function.

YosysHQ/yosys,cliffordwolf/yosys,YosysHQ/yosys,cliffordwolf/yosys,antmicro/yosys,antmicro/yosys,cliffordwolf/yosys,YosysHQ/yosys,YosysHQ/yosys,cliffordwolf/yosys,antmicro/yosys,antmicro/yosys,YosysHQ/yosys,cliffordwolf/yosys,cliffordwolf/yosys,cliffordwolf/yosys,antmicro/yosys,YosysHQ/yosys,cliffordwolf/yosys,antmicro/yosys,antmicro/yosys,YosysHQ/yosys,antmicro/yosys,cliffordwolf/yosys,YosysHQ/yosys