test(network): Add tests for top-level network functions

This adds exhaustive tests for the functions in network.go.