Proper server shutdown
Refactoring, fixed global cfg access
Opt-in allowed ips
Using netaddr package