Refactor to support deep inheritance.
Cleaned up tests. Rebuilt dist.