Moved resistor network and adjacency matrix work to modules and used that to clean up a bit of code.