separate unittest from the main module, implement new method is_subnet, add more tests