Add support for inheritance in Directives and Components

Implements #457