Add support for inheritance

Closes #2