Added subnet handling, plus test case, similar to that used by JavaFBP and C#FBP; some storage leaks