Rework hooks to support network space binding of the hanode
peer relation to a specific network space.
Note that the get_relation_ip function also deals with the
'prefer-ipv6' legacy configuration option handling, so it
was safe to remove some charm specific code in this area.
Change-Id: Ic69e97debddba42e3d4a140f7f9cfc95768f71c3
Closes-Bug: 1659464