refactor network_list method

Split the chain of functional code into smaller, well-named
methods.
run tests as default rake task