IP class cleanups

* Removed clumsy and unused toOctet() method
* Avoid internal use of ugly toUnsigned() method
* Use proper return value for toHex() on failure
* Converted isPublic() to use IPSet

Change-Id: I36d0e08fe96f15380aea77ad4a39e93104023ce3
Merge "IP class cleanups"