Add support for generic hierarchies in domain classes - Fix for issue #6

This is a proposed fix for issue #6.  Added test cases to demonstrate the fix.