Add Windows support using `netsh`

Also some other code cleanup.