Cleanup all IP formatting code

Instead of manually checking for strchr(n,':') everywhere,
we can use our new centralized IP formatting functions.