Fancy networks

See docs/networks.md for details.

Unit tests pass, but I should write some more unit tests to test the expanded functionality before we merge this.
This is described in great detail in docs/networks.md .  Should I link to there?