Cleaned up Subnet.java and added/extended unit tests.