Add tests for merging/unmerging network configurations.
Fix bugs in context tests.