test(machine): Add more testing of machine pkg
refactor(machine): Break apart local network interface code

* Break apart machine.GetAddresses for testability
* Move IP address-related code into machine/ip.go
* Add tests for new IP address-related code