Move flag-related code into new pkg package

also move Addrs in main.go?