Issue 91 joined inheritance

Many issues fixed, inheritance auditing rewritten. Many new tricky test cases.

Closes #91, #90, #87 

Based on #92 so if you merge this close PR #92 (otherwise I can rebase).