Enhance support for bean inheritance

Replaced the __dict__ and __slots__ trick by inspect.getmembers().
Beans inheriting fields from parent classes using __dict__ and/or __slots__
are now supported.
Corrected call to inspect.getmodule for some cases

It was possible that for some objects, mainly C++-side objects, inspect.getmodule() returned None.