Use __qualname__ where appropriate

The __qualname__ attribute simplifies the determination
of an objects class name and callable name and is useful
in python 3.x to be able to use since it can correctly
identify names better than the python 2.x __name__ attribute
can.

Adds a few tests in to ensure that the usage of __qualname__
where available functions as expected.

See: http://legacy.python.org/dev/peps/pep-3155/

Fixes bug 1341441

Change-Id: Ic6942cbbc8e35d65fb3ac603ff1dfc8e20c194a3
Merge "Use __qualname__ where appropriate"