Adding firewall and ACL support

Not working correctly yet! Still WIP…
Fixed a bug with calculating the IP/network info from the CIDR

In some cases the calculation ended up in an endless loop, so
refactored that part so it no longer needs a loop at all making it more
efficient at the same time.