Use __qualname__ if we can

Due to pep-3155 functions and methods will now have more
uniform qualified names that we can and should use when
we can (mainly applicable to python 3.x).

Once https://review.openstack.org/#/c/122495/ goes in we
can just use that module instead to get similar functionality.

Change-Id: Iea9e74aca38aa79c9294fd6e786551e91143900c
Merge "Use __qualname__ if we can"